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

Unified Diff: third_party/WebKit/Source/wtf/text/StringBuilder.cpp

Issue 1373773002: Fix check-webkit-style errors in Source/wtf/text/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | third_party/WebKit/Source/wtf/text/StringHash.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/wtf/text/StringBuilder.cpp
diff --git a/third_party/WebKit/Source/wtf/text/StringBuilder.cpp b/third_party/WebKit/Source/wtf/text/StringBuilder.cpp
index 9236bf6fb55526c337cbc82ed4074f5da8cbc934..5b075f0a4403efe387f41999ab818ef4145c712d 100644
--- a/third_party/WebKit/Source/wtf/text/StringBuilder.cpp
+++ b/third_party/WebKit/Source/wtf/text/StringBuilder.cpp
@@ -170,8 +170,9 @@ void StringBuilder::reallocateBuffer<LChar>(unsigned requiredLength)
if (m_buffer->hasOneRef()) {
m_buffer = StringImpl::reallocate(m_buffer.release(), requiredLength);
m_bufferCharacters8 = const_cast<LChar*>(m_buffer->characters8());
- } else
+ } else {
allocateBuffer(m_buffer->characters8(), requiredLength);
+ }
}
template <>
@@ -186,8 +187,9 @@ void StringBuilder::reallocateBuffer<UChar>(unsigned requiredLength)
} else if (m_buffer->hasOneRef()) {
m_buffer = StringImpl::reallocate(m_buffer.release(), requiredLength);
m_bufferCharacters16 = const_cast<UChar*>(m_buffer->characters16());
- } else
+ } else {
allocateBuffer(m_buffer->characters16(), requiredLength);
+ }
}
void StringBuilder::reserveCapacity(unsigned newCapacity)
@@ -206,10 +208,11 @@ void StringBuilder::reserveCapacity(unsigned newCapacity)
if (!m_length) {
LChar* nullPlaceholder = 0;
allocateBuffer(nullPlaceholder, newCapacity);
- } else if (m_string.is8Bit())
+ } else if (m_string.is8Bit()) {
allocateBuffer(m_string.characters8(), newCapacity);
- else
+ } else {
allocateBuffer(m_string.characters16(), newCapacity);
+ }
}
}
}
@@ -290,8 +293,9 @@ void StringBuilder::append(const UChar* characters, unsigned length)
memcpy(m_bufferCharacters16 + m_length, characters, static_cast<size_t>(length) * sizeof(UChar));
m_length = requiredLength;
- } else
+ } else {
memcpy(appendUninitialized<UChar>(length), characters, static_cast<size_t>(length) * sizeof(UChar));
+ }
}
void StringBuilder::append(const LChar* characters, unsigned length)
@@ -302,9 +306,9 @@ void StringBuilder::append(const LChar* characters, unsigned length)
if (m_is8Bit) {
LChar* dest = appendUninitialized<LChar>(length);
- if (length > 8)
+ if (length > 8) {
memcpy(dest, characters, static_cast<size_t>(length) * sizeof(LChar));
- else {
+ } else {
const LChar* end = characters + length;
while (characters < end)
*(dest++) = *(characters++);
« no previous file with comments | « third_party/WebKit/Source/wtf/text/StringBuilder.h ('k') | third_party/WebKit/Source/wtf/text/StringHash.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698