Changeset 40975 in webkit for trunk/JavaScriptCore/runtime/UString.cpp
- Timestamp:
- Feb 13, 2009, 8:16:50 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/runtime/UString.cpp
r40169 r40975 1420 1420 int UString::find(const UString& f, int pos) const 1421 1421 { 1422 int fsz = f.size(); 1423 1424 if (pos < 0) 1425 pos = 0; 1426 1427 if (fsz == 1) { 1428 UChar ch = f[0]; 1429 const UChar* end = data() + size(); 1430 for (const UChar* c = data() + pos; c < end; c++) { 1431 if (*c == ch) 1432 return static_cast<int>(c - data()); 1433 } 1434 return -1; 1435 } 1436 1422 1437 int sz = size(); 1423 int fsz = f.size();1424 1438 if (sz < fsz) 1425 1439 return -1; 1426 if (pos < 0)1427 pos = 0;1428 1440 if (fsz == 0) 1429 1441 return pos;
Note:
See TracChangeset
for help on using the changeset viewer.