Changeset 61924 in webkit for trunk/JavaScriptCore/runtime/RegExpCache.cpp
- Timestamp:
- Jun 25, 2010, 5:41:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/RegExpCache.cpp
r61845 r61924 38 38 if (!result.second) 39 39 return result.first->second; 40 else 41 return create(patternString, flags, result.first); 40 42 } 41 return create(patternString, flags );43 return create(patternString, flags, m_cacheMap.end()); 42 44 } 43 45 44 PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UString& flags )46 PassRefPtr<RegExp> RegExpCache::create(const UString& patternString, const UString& flags, RegExpCacheMap::iterator iterator) 45 47 { 46 RefPtr<RegExp> regExp; 47 48 if (!flags.isNull()) 49 regExp = RegExp::create(m_globalData, patternString, flags); 50 else 51 regExp = RegExp::create(m_globalData, patternString); 48 RefPtr<RegExp> regExp = RegExp::create(m_globalData, patternString, flags); 52 49 53 50 if (patternString.size() >= maxCacheablePatternLength) … … 63 60 64 61 RegExpKey key = RegExpKey(flags, patternString); 65 m_cacheMap.set(key, regExp); 62 iterator->first = key; 63 iterator->second = regExp; 66 64 patternKeyArray[m_nextKeyToEvict].flagsValue = key.flagsValue; 67 65 patternKeyArray[m_nextKeyToEvict].pattern = patternString.rep();
Note:
See TracChangeset
for help on using the changeset viewer.