From ad2a6c0662229f8a07fb3d6344e6dab9f36097a0 Mon Sep 17 00:00:00 2001 From: szv Date: Thu, 28 Mar 2013 12:13:26 +0400 Subject: [PATCH] 0023867: Reading performance improvement Small improvement in TCollection_AsciiString::Search. --- src/TCollection/TCollection_AsciiString.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/TCollection/TCollection_AsciiString.cxx b/src/TCollection/TCollection_AsciiString.cxx index 29374177da..8504eb5e1e 100755 --- a/src/TCollection/TCollection_AsciiString.cxx +++ b/src/TCollection/TCollection_AsciiString.cxx @@ -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; }