Răsfoiți Sursa

* reverted TryStrToInt to the old implementation since after the val fixed the changes are not
needed anymore as pointed out by Bart B

(cherry picked from commit 0764158fd11f3ba1a72143f0430e4ccdcb2c0116)

florian 3 ani în urmă
părinte
comite
18b6588bda
1 a modificat fișierele cu 3 adăugiri și 5 ștergeri
  1. 3 5
      rtl/objpas/sysutils/sysstr.inc

+ 3 - 5
rtl/objpas/sysutils/sysstr.inc

@@ -959,14 +959,12 @@ end;
 function TryStrToInt(const s: string; out i : Longint) : boolean;
 var
   Error : word;
-  li : Int64;
 begin
-  Val(s, li, Error);
-  TryStrToInt:=(Error=0) and (li<=High(DWord)) and (li>=Low(Longint));
-  if TryStrToInt then
-    i:=li;
+  Val(s, i, Error);
+  TryStrToInt:=(Error=0)
 end;
 
+
 {   StrToInt converts the string S to an integer value,
     if S does not represent a valid integer value EConvertError is raised  }
 function StrToInt(const S: string): Longint;