Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: third_party/WebKit/Source/wtf/text/StringBuilder.cpp

Issue 1528323002: Include <algorithm> if you use functions from <algorithm>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Split ui parts into a separate review Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2010 Apple Inc. All rights reserved.
3 * Copyright (C) 2012 Google Inc. All rights reserved. 3 * Copyright (C) 2012 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "StringBuilder.h" 28 #include "StringBuilder.h"
29 29
30 #include "IntegerToStringConversion.h" 30 #include "IntegerToStringConversion.h"
31 #include "WTFString.h" 31 #include "WTFString.h"
32 #include "wtf/dtoa.h" 32 #include "wtf/dtoa.h"
33 #include <algorithm>
33 34
34 namespace WTF { 35 namespace WTF {
35 36
36 static unsigned expandedCapacity(unsigned capacity, unsigned requiredLength) 37 static unsigned expandedCapacity(unsigned capacity, unsigned requiredLength)
37 { 38 {
38 static const unsigned minimumCapacity = 16; 39 static const unsigned minimumCapacity = 16;
39 return std::max(requiredLength, std::max(minimumCapacity, capacity * 2)); 40 return std::max(requiredLength, std::max(minimumCapacity, capacity * 2));
40 } 41 }
41 42
42 void StringBuilder::reifyString() 43 void StringBuilder::reifyString()
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 if (!canShrink()) 377 if (!canShrink())
377 return; 378 return;
378 if (m_is8Bit) 379 if (m_is8Bit)
379 reallocateBuffer<LChar>(m_length); 380 reallocateBuffer<LChar>(m_length);
380 else 381 else
381 reallocateBuffer<UChar>(m_length); 382 reallocateBuffer<UChar>(m_length);
382 m_string = m_buffer.release(); 383 m_string = m_buffer.release();
383 } 384 }
384 385
385 } // namespace WTF 386 } // namespace WTF
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/wtf/Optional.h ('k') | third_party/WebKit/Source/wtf/text/StringImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698