OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) | 4 * (C) 2001 Dirk Mueller ( mueller@kde.org ) |
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2013 Apple Inc. All r ights reserved. |
6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) | 6 * Copyright (C) 2006 Andrew Wellington (proton@wiretapped.net) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 1916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1927 | 1927 |
1928 return equal(a->characters16(), b->characters16(), aLength); | 1928 return equal(a->characters16(), b->characters16(), aLength); |
1929 } | 1929 } |
1930 | 1930 |
1931 bool equal(const StringImpl* a, const StringImpl* b) | 1931 bool equal(const StringImpl* a, const StringImpl* b) |
1932 { | 1932 { |
1933 if (a == b) | 1933 if (a == b) |
1934 return true; | 1934 return true; |
1935 if (!a || !b) | 1935 if (!a || !b) |
1936 return false; | 1936 return false; |
1937 if (a->isAtomic() && b->isAtomic()) | |
1938 return false; | |
abarth-chromium
2014/03/06 18:52:05
Can we land this change separately? This code is c
| |
1937 | 1939 |
1938 return stringImplContentEqual(a, b); | 1940 return stringImplContentEqual(a, b); |
1939 } | 1941 } |
1940 | 1942 |
1941 template <typename CharType> | 1943 template <typename CharType> |
1942 inline bool equalInternal(const StringImpl* a, const CharType* b, unsigned lengt h) | 1944 inline bool equalInternal(const StringImpl* a, const CharType* b, unsigned lengt h) |
1943 { | 1945 { |
1944 if (!a) | 1946 if (!a) |
1945 return !b; | 1947 return !b; |
1946 if (!b) | 1948 if (!b) |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2105 | 2107 |
2106 size_t StringImpl::sizeInBytes() const | 2108 size_t StringImpl::sizeInBytes() const |
2107 { | 2109 { |
2108 size_t size = length(); | 2110 size_t size = length(); |
2109 if (!is8Bit()) | 2111 if (!is8Bit()) |
2110 size *= 2; | 2112 size *= 2; |
2111 return size + sizeof(*this); | 2113 return size + sizeof(*this); |
2112 } | 2114 } |
2113 | 2115 |
2114 } // namespace WTF | 2116 } // namespace WTF |
OLD | NEW |