mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-29 22:03:40 -06:00
Core: Optimizing String
git-svn-id: svn://ultimatepp.org/upp/trunk@9403 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
77a388ba8f
commit
cd830c1215
3 changed files with 19 additions and 15 deletions
|
|
@ -90,11 +90,8 @@ int String0::LCompare(const String0& s) const
|
|||
int la = GetLength();
|
||||
const char *b = s.Begin();
|
||||
int lb = s.GetLength();
|
||||
int l = min(la, lb);
|
||||
for(int i = 0; i < l; i++) {
|
||||
int q = (byte)a[i] - (byte)b[i];
|
||||
if(q) return q;
|
||||
}
|
||||
int q = fast_memcmp(a, b, min(la, lb));
|
||||
if(q) return q;
|
||||
return la - lb;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue