Browse Source

* Micro-optimization, bug id #38044

git-svn-id: trunk@47327 -
michael 5 years ago
parent
commit
51c3787342
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/rtl-objpas/src/inc/strutils.pp

+ 2 - 2
packages/rtl-objpas/src/inc/strutils.pp

@@ -355,7 +355,7 @@ type
     i: SizeInt;
   begin
     i:=0;
-    while (aPattern[aPos-i] = aPattern[aPatternSize-1-i]) and (i < aPos) do begin
+    while (i<aPos) and (aPattern[aPos-i] = aPattern[aPatternSize-1-i]) do begin
       inc(i);
     end;
     Result:=i;
@@ -493,7 +493,7 @@ type
     i: SizeInt;
   begin
     i:=0;
-    while (aPattern[aPos-i] = aPattern[aPatternSize-1-i]) and (i < aPos) do begin
+    while (i<aPos) and (aPattern[aPos-i] = aPattern[aPatternSize-1-i]) do begin
       inc(i);
     end;
     Result:=i;