0023867: Reading performance improvement
authorszv <szv@opencascade.com>
Thu, 28 Mar 2013 08:13:26 +0000 (12:13 +0400)
committerszv <szv@opencascade.com>
Fri, 5 Apr 2013 06:22:57 +0000 (10:22 +0400)
Small improvement in TCollection_AsciiString::Search.

src/TCollection/TCollection_AsciiString.cxx

index 2937417..8504eb5 100755 (executable)
@@ -1339,14 +1339,12 @@ Standard_Integer TCollection_AsciiString::Search
   if (size) {
     int k,j;
     int i = 0;
-    Standard_Boolean find = Standard_False; 
-    while ( i < mylength-size+1 && !find) {
+    while ( i < mylength-size+1 ) {
       k = i++;
       j = 0;
       while (j < size && mystring[k++] == what[j++])
-        if (j == size) find = Standard_True;
+        if (j == size) return i;
     }
-    if (find)  return i;
   }
   return -1;
 }