Changeset 66031 in webkit for trunk/JavaScriptCore/runtime/RegExp.cpp
- Timestamp:
- Aug 25, 2010, 11:55:26 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/RegExp.cpp
r65468 r66031 52 52 , m_constructionError(0) 53 53 , m_numSubpatterns(0) 54 , m_lastMatchStart(-1)55 54 { 56 55 // NOTE: The global flag is handled on a case-by-case basis by functions like … … 97 96 ovector->resize(0); 98 97 99 if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) { 100 m_lastMatchString = UString(); 101 m_lastMatchStart = -1; 102 m_lastOVector.shrink(0); 98 if (static_cast<unsigned>(startOffset) > s.length() || s.isNull()) 103 99 return -1; 104 }105 106 // Perform check to see if this match call is the same as the last match invocation107 // and if it is return the prior result.108 if ((startOffset == m_lastMatchStart) && (s.impl() == m_lastMatchString.impl())) {109 if (ovector)110 *ovector = m_lastOVector;111 112 if (m_lastOVector.isEmpty())113 return -1;114 115 return m_lastOVector.at(0);116 }117 100 118 101 #if ENABLE(YARR_JIT) … … 152 135 } 153 136 154 m_lastMatchString = s;155 m_lastMatchStart = startOffset;156 157 if (ovector)158 m_lastOVector = *ovector;159 else160 m_lastOVector = nonReturnedOvector;161 162 137 return result; 163 138 } 164 165 m_lastMatchString = UString();166 m_lastMatchStart = -1;167 m_lastOVector.shrink(0);168 139 169 140 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.