mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-26 10:19:45 +03:00
0023867: Reading performance improvement
Small improvement in TCollection_AsciiString::Search.
This commit is contained in:
parent
f2cc47113f
commit
ad2a6c0662
@ -1339,14 +1339,12 @@ Standard_Integer TCollection_AsciiString::Search
|
|||||||
if (size) {
|
if (size) {
|
||||||
int k,j;
|
int k,j;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
Standard_Boolean find = Standard_False;
|
while ( i < mylength-size+1 ) {
|
||||||
while ( i < mylength-size+1 && !find) {
|
|
||||||
k = i++;
|
k = i++;
|
||||||
j = 0;
|
j = 0;
|
||||||
while (j < size && mystring[k++] == what[j++])
|
while (j < size && mystring[k++] == what[j++])
|
||||||
if (j == size) find = Standard_True;
|
if (j == size) return i;
|
||||||
}
|
}
|
||||||
if (find) return i;
|
|
||||||
}
|
}
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user