[SOLVED] Improvement of rtl/objpas/sysutils/sysstr.inc function CompareStr lazarus / 64-FPC development ---------------------------------------------------------------------- lagprogramming · 2023-03-25 13:56 The function has a useless declaration of variable "res". Also useless is the initial "result := 0;" assignment. Here is the content of the function. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function CompareStr(const S1, S2: string): Integer;var res,count, count1, count2: SizeInt;begin  result := 0;  Count1 := Length(S1);  Count2 := Length(S2);  if Count1>Count2 then    Count:=Count2  else    Count:=Count1;  result := CompareMemRange(Pointer(S1),Pointer(S2), Count);  if result=0 then    // CAPSIZEINT is no-op if Sizeof(Sizeint)<=SizeOF(Integer)    result:=CAPSIZEINT(Count1-Count2);end; ---------------------------------------------------------------------- lagprogramming · 2023-04-09 14:08 Here is a patch Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i diff --git a/rtl/objpas/sysutils/sysstr.inc b/rtl/objpas/sysutils/sysstr.incindex 318ef2c03c..ee45222d2f 100644--- a/rtl/objpas/sysutils/sysstr.inc+++ b/rtl/objpas/sysutils/sysstr.inc@@ -181,9 +181,8 @@ function LowerCase(const V: variant): string; overload;{$ifdef SYSUTILSINLINE}in {$ENDIF}  function CompareStr(const S1, S2: string): Integer;-var res,count, count1, count2: SizeInt;+var count, count1, count2: SizeInt; begin-  result := 0;   Count1 := Length(S1);   Count2 := Length(S2);   if Count1>Count2 then