Core: Optimizing String

git-svn-id: svn://ultimatepp.org/upp/trunk@9403 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2016-01-16 13:55:25 +00:00
parent 77a388ba8f
commit cd830c1215
3 changed files with 19 additions and 15 deletions

View file

@ -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;
}