Changeset 143538 in webkit


Ignore:
Timestamp:
Feb 20, 2013, 4:49:57 PM (12 years ago)
Author:
alecflett@chromium.org
Message:

LevelDB: Remove excess vector copy
https://bugs.webkit.org/show_bug.cgi?id=110399

Reviewed by Tony Chang.

Remove an extra copy introduced by the makeVector function.

No new tests, this is covered by existing tests.

  • platform/leveldb/LevelDBDatabase.cpp:

(WebCore::LevelDBDatabase::safeGet):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r143537 r143538  
     12013-02-20  Alec Flett  <alecflett@chromium.org>
     2
     3        LevelDB: Remove excess vector copy
     4        https://bugs.webkit.org/show_bug.cgi?id=110399
     5
     6        Reviewed by Tony Chang.
     7
     8        Remove an extra copy introduced by the makeVector function.
     9
     10        No new tests, this is covered by existing tests.
     11
     12        * platform/leveldb/LevelDBDatabase.cpp:
     13        (WebCore::LevelDBDatabase::safeGet):
     14
    1152013-02-20  Simon Fraser  <simon.fraser@apple.com>
    216
  • trunk/Source/WebCore/platform/leveldb/LevelDBDatabase.cpp

    r143512 r143538  
    7676}
    7777
    78 static Vector<char> makeVector(const std::string& s)
    79 {
    80     Vector<char> res;
    81     res.append(s.c_str(), s.length());
    82     return res;
    83 }
    84 
    8578class ComparatorAdapter : public leveldb::Comparator {
    8679public:
     
    228221    if (s.ok()) {
    229222        found = true;
    230         value = makeVector(result);
     223        value.clear();
     224        value.append(result.c_str(), result.length());
    231225        return true;
    232226    }
Note: See TracChangeset for help on using the changeset viewer.