[webkit-reviews] review granted: [Bug 130438] Small cleanup of empty string : [Attachment 227144] Fix
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Mar 18 19:21:53 PDT 2014
Anders Carlsson <andersca at apple.com> has granted Gavin Barraclough
<barraclough at apple.com>'s request for review:
Bug 130438: Small cleanup of empty string
https://bugs.webkit.org/show_bug.cgi?id=130438
Attachment 227144: Fix
https://bugs.webkit.org/attachment.cgi?id=227144&action=review
------- Additional Comments from Anders Carlsson <andersca at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=227144&action=review
> Source/WTF/wtf/text/StringImpl.h:164
> + , m_data8(reinterpret_cast<LChar*>(1))
Even though this is what the comment said, I think it's awkward. I think you
should do what we do for the StringImpl(CreateEmptyUniqueTag) constructor
instead:
// We expect m_length to be initialized to 0 as we use it
// to represent a null terminated buffer.
, m_data8(reinterpret_cast<const LChar*>(&m_length))
> Source/WTF/wtf/text/StringStatics.cpp:46
> + DEPRECATED_DEFINE_STATIC_LOCAL(StringImpl, emptyString,
(ConstructEmptyString));
Please change this to
static NeverDestroyed<StringImpl> emptyString(ConstructEmptyString);
instead.
More information about the webkit-reviews
mailing list