Changeset 175949 in webkit
- Timestamp:
- Nov 11, 2014, 9:40:07 AM (12 years ago)
- Location:
- releases/WebKitGTK/webkit-2.6/Source/WebCore
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
dom/SpaceSplitString.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
releases/WebKitGTK/webkit-2.6/Source/WebCore/ChangeLog
r175948 r175949 1 2014-11-04 Chris Dumez <cdumez@apple.com> 2 3 Avoid double hash table lookup in SpaceSplitStringData::create() 4 https://bugs.webkit.org/show_bug.cgi?id=138396 5 6 Reviewed by Ryosuke Niwa. 7 8 Avoid double hash table lookup in SpaceSplitStringData::create() by 9 calling HashMap::add() and using the AddResult, instead of calling 10 HashMap::get() then HashMap::add(). 11 12 No new tests, no behavior change. 13 14 * dom/SpaceSplitString.cpp: 15 (WebCore::SpaceSplitStringData::create): 16 1 17 2014-11-04 Andreas Kling <akling@apple.com> 2 18 -
releases/WebKitGTK/webkit-2.6/Source/WebCore/dom/SpaceSplitString.cpp
r169358 r175949 193 193 ASSERT(!keyString.isNull()); 194 194 195 auto & table = spaceSplitStringTable();196 if ( SpaceSplitStringData* data = table.get(keyString))197 return data;195 auto addResult = spaceSplitStringTable().add(keyString, nullptr); 196 if (!addResult.isNewEntry) 197 return addResult.iterator->value; 198 198 199 199 // Nothing in the cache? Let's create a new SpaceSplitStringData if the input has something useful. … … 207 207 208 208 RefPtr<SpaceSplitStringData> spaceSplitStringData = create(keyString, tokenCount); 209 table.add(keyString, spaceSplitStringData.get());209 addResult.iterator->value = spaceSplitStringData.get(); 210 210 return spaceSplitStringData.release(); 211 211 }
Note:
See TracChangeset
for help on using the changeset viewer.