| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. | 3 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights
reserved. |
| 4 * Copyright (C) 2009 Google Inc. All rights reserved. | 4 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 | 289 |
| 290 --m_refCount; | 290 --m_refCount; |
| 291 } | 291 } |
| 292 | 292 |
| 293 static StringImpl* empty(); | 293 static StringImpl* empty(); |
| 294 | 294 |
| 295 // FIXME: Does this really belong in StringImpl? | 295 // FIXME: Does this really belong in StringImpl? |
| 296 template <typename T> static void copyChars(T* destination, const T* source,
unsigned numCharacters) | 296 template <typename T> static void copyChars(T* destination, const T* source,
unsigned numCharacters) |
| 297 { | 297 { |
| 298 if (numCharacters == 1) { | |
| 299 *destination = *source; | |
| 300 return; | |
| 301 } | |
| 302 | |
| 303 memcpy(destination, source, numCharacters * sizeof(T)); | 298 memcpy(destination, source, numCharacters * sizeof(T)); |
| 304 } | 299 } |
| 305 | 300 |
| 306 ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source,
unsigned numCharacters) | 301 ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source,
unsigned numCharacters) |
| 307 { | 302 { |
| 308 for (unsigned i = 0; i < numCharacters; ++i) | 303 for (unsigned i = 0; i < numCharacters; ++i) |
| 309 destination[i] = source[i]; | 304 destination[i] = source[i]; |
| 310 } | 305 } |
| 311 | 306 |
| 312 // Some string features, like refcounting and the atomicity flag, are not | 307 // Some string features, like refcounting and the atomicity flag, are not |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 } | 731 } |
| 737 | 732 |
| 738 using WTF::StringImpl; | 733 using WTF::StringImpl; |
| 739 using WTF::equal; | 734 using WTF::equal; |
| 740 using WTF::equalNonNull; | 735 using WTF::equalNonNull; |
| 741 using WTF::TextCaseSensitivity; | 736 using WTF::TextCaseSensitivity; |
| 742 using WTF::TextCaseSensitive; | 737 using WTF::TextCaseSensitive; |
| 743 using WTF::TextCaseInsensitive; | 738 using WTF::TextCaseInsensitive; |
| 744 | 739 |
| 745 #endif | 740 #endif |
| OLD | NEW |