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

Unified Diff: Source/wtf/text/StringBuffer.h

Issue 520723002: Stop inlining StringBuffer<CharType>::shrink(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: StringBuffer::shrink(). Warnings signed 0 compared to unsigned length. Created 6 years, 4 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 | « no previous file | Source/wtf/text/StringBufferTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/text/StringBuffer.h
diff --git a/Source/wtf/text/StringBuffer.h b/Source/wtf/text/StringBuffer.h
index 2498f5d295ff3b0eab3dace622ee6c00558a52d6..952cfb4041633c2daac69c10bde99ee49c6f0122 100644
--- a/Source/wtf/text/StringBuffer.h
+++ b/Source/wtf/text/StringBuffer.h
@@ -51,13 +51,7 @@ public:
{
}
- void shrink(unsigned newLength)
- {
- if (m_data->length() == newLength)
- return;
- m_data->truncateAssumingIsolated(newLength);
- }
-
+ void shrink(unsigned newLength);
void resize(unsigned newLength)
{
if (!m_data) {
@@ -83,6 +77,15 @@ private:
RefPtr<StringImpl> m_data;
};
+template <typename CharType>
+void StringBuffer<CharType>::shrink(unsigned newLength)
+{
+ ASSERT(m_data);
+ if (m_data->length() == newLength)
+ return;
+ m_data->truncateAssumingIsolated(newLength);
+}
+
} // namespace WTF
using WTF::StringBuffer;
« no previous file with comments | « no previous file | Source/wtf/text/StringBufferTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698