Changeset 2736 in webkit for trunk/JavaScriptCore/kjs/ustring.cpp
- Timestamp:
- Nov 18, 2002, 1:55:23 PM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/ustring.cpp
r2304 r2736 643 643 return (l1 < l2); 644 644 } 645 646 int KJS::compare(const UString& s1, const UString& s2) 647 { 648 const int l1 = s1.size(); 649 const int l2 = s2.size(); 650 const int lmin = l1 < l2 ? l1 : l2; 651 const UChar *c1 = s1.data(); 652 const UChar *c2 = s2.data(); 653 int l = 0; 654 while (l < lmin && *c1 == *c2) { 655 c1++; 656 c2++; 657 l++; 658 } 659 if (l < lmin) 660 return (c1->unicode() > c2->unicode()) ? 1 : -1; 661 662 if (l1 == l2) { 663 return 0; 664 } 665 return (l1 < l2) ? 1 : -1; 666 }
Note:
See TracChangeset
for help on using the changeset viewer.