Changeset 51705 in webkit


Ignore:
Timestamp:
Dec 4, 2009 12:01:20 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-12-04 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>

Reviewed by Darin Adler.

Check whether the right side of a string append is non-empty
https://bugs.webkit.org/show_bug.cgi?id=32151

Especially beneficial for CachedScript::script() method
which usually appends an empty string returned by flush()
to its m_script member. m_script is often hundreds of kbytes
which is duplated without reason.

  • platform/text/String.cpp: (WebCore::String::append):
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r51704 r51705  
     12009-12-04  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
     2
     3        Reviewed by Darin Adler.
     4
     5        Check whether the right side of a string append is non-empty
     6        https://bugs.webkit.org/show_bug.cgi?id=32151
     7
     8        Especially beneficial for CachedScript::script() method
     9        which usually appends an empty string returned by flush()
     10        to its m_script member. m_script is often hundreds of kbytes
     11        which is duplated without reason.
     12
     13        * platform/text/String.cpp:
     14        (WebCore::String::append):
     15
    1162009-12-04  Enrica Casucci  <enrica@apple.com>
    217
  • trunk/WebCore/platform/text/String.cpp

    r50103 r51705  
    8282void String::append(const String& str)
    8383{
     84    if (str.isEmpty())
     85       return;
     86
    8487    // FIXME: This is extremely inefficient. So much so that we might want to take this
    8588    // out of String's API. We can make it better by optimizing the case where exactly
Note: See TracChangeset for help on using the changeset viewer.