SynEdit, FpDebug, LazUtils, IdeIntf: Remove UTF8CompareLatinTextFast calls.

This commit is contained in:
Juha 2024-02-08 11:48:41 +02:00
parent bc201de1ed
commit 08c0f4865d
7 changed files with 18 additions and 17 deletions

View File

@ -43,8 +43,10 @@ unit FpDbgDwarfDataClasses;
interface interface
uses uses
Classes, Types, SysUtils, contnrs, Math, Maps, LazClasses, LazFileUtils, Classes, Types, SysUtils, Contnrs, Math,
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}, LazUTF8, lazCollections, // LazUtils
Maps, LazClasses, LazFileUtils, LazUTF8, LazCollections,
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif},
// FpDebug // FpDebug
FpDbgUtil, FpDbgInfo, FpDbgDwarfConst, FpDbgCommon, FpDbgDwarfCFI, FpDbgUtil, FpDbgInfo, FpDbgDwarfConst, FpDbgCommon, FpDbgDwarfCFI,
FpDbgLoader, FpImgReaderBase, FpdMemoryTools, FpErrorMessages, DbgIntfBaseTypes; FpDbgLoader, FpImgReaderBase, FpdMemoryTools, FpErrorMessages, DbgIntfBaseTypes;
@ -5194,7 +5196,7 @@ function TDwarfCompilationUnit.GetLineAddressMap(const AFileName: String): PDWar
if Result <> -1 then Exit; if Result <> -1 then Exit;
for Result := 0 to FLineNumberMap.Count - 1 do for Result := 0 to FLineNumberMap.Count - 1 do
if UTF8CompareLatinTextFast(Name, ExtractFileName(FLineNumberMap[Result])) = 0 then if AnsiCompareText(Name, ExtractFileName(FLineNumberMap[Result])) = 0 then
Exit; Exit;
Result := -1; Result := -1;
end; end;

View File

@ -18,7 +18,7 @@ uses
// LCL // LCL
StdCtrls, ImgList, Graphics, StdCtrls, ImgList, Graphics,
// LazUtils // LazUtils
LazUTF8, LazFileUtils; LazFileUtils;
type type
TCmpStrType = ( TCmpStrType = (
@ -54,7 +54,7 @@ begin
for i:=0 to List.Count-1 do begin for i:=0 to List.Count-1 do begin
case Cmp of case Cmp of
cstCaseSensitive: if List[i]=s then exit(i); cstCaseSensitive: if List[i]=s then exit(i);
cstCaseInsensitive: if UTF8CompareLatinTextFast(List[i],s)=0 then exit(i); cstCaseInsensitive: if AnsiCompareText(List[i],s)=0 then exit(i);
cstFilename: if CompareFilenames(List[i],s)=0 then exit(i); cstFilename: if CompareFilenames(List[i],s)=0 then exit(i);
end; end;
end; end;

View File

@ -6,7 +6,7 @@
for details about the license. for details about the license.
***************************************************************************** *****************************************************************************
} }
unit lazCollections; unit LazCollections;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{$ModeSwitch advancedrecords} {$ModeSwitch advancedrecords}

View File

@ -384,7 +384,7 @@ begin
if CaseSensitive then if CaseSensitive then
Result := CompareStr(FnExt, Ext) Result := CompareStr(FnExt, Ext)
else else
Result := UTF8CompareLatinTextFast(FnExt, Ext); Result := CompareText(FnExt, Ext);
if Result < 0 then if Result < 0 then
Result := -1 Result := -1
else if Result > 0 then else if Result > 0 then

View File

@ -24,9 +24,9 @@ unit pocheckermain;
interface interface
uses uses
Classes, SysUtils, FileUtil, LazFileUtils, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, Types,
StdCtrls, CheckLst, Buttons, ExtCtrls, ComCtrls, Types, FileUtil, LazFileUtils,
LCLType, LazUTF8, Forms, Controls, Graphics, Dialogs, StdCtrls, CheckLst, Buttons, ExtCtrls, ComCtrls, LCLType,
{$IFDEF POCHECKERSTANDALONE} {$IFDEF POCHECKERSTANDALONE}
LCLTranslator, LCLTranslator,
{$ELSE} {$ELSE}
@ -566,7 +566,7 @@ end;
function ListSortFunc(List: TStringList; Index1, Index2: Integer): Integer; function ListSortFunc(List: TStringList; Index1, Index2: Integer): Integer;
begin begin
Result := UTF8CompareLatinTextFast(List.Strings[Index1], List.Strings[Index2]); Result := CompareText(List.Strings[Index1], List.Strings[Index2]);
end; end;
function TPoCheckerForm.LangFilterIndexToLangID(Index: Integer): TLangID; function TPoCheckerForm.LangFilterIndexToLangID(Index: Integer): TLangID;

View File

@ -1158,16 +1158,15 @@ begin
end else begin end else begin
if FCaseSensitive then begin if FCaseSensitive then begin
for i := 0 to Pred(ItemList.Count) do for i := 0 to Pred(ItemList.Count) do
if 0 = CompareStr(fCurrentString, if 0 = CompareStr(fCurrentString, Copy(ItemList[i], 1, Length(fCurrentString)))
Copy(ItemList[i], 1, Length(fCurrentString)))
then begin then begin
Position := i; Position := i;
break; break;
end; end;
end else begin end else begin
for i := 0 to Pred(ItemList.Count) do for i := 0 to Pred(ItemList.Count) do
if 0 = UTF8CompareLatinTextFast(fCurrentString, if 0 = AnsiCompareText(fCurrentString,
Copy(ItemList[i], 1, Length(fCurrentString))) Copy(ItemList[i], 1, Length(fCurrentString)))
then begin then begin
Position := i; Position := i;
break; break;

View File

@ -275,9 +275,9 @@ begin
end else begin end else begin
while i > -1 do begin while i > -1 do begin
s := fCompletions[i]; s := fCompletions[i];
if UTF8CompareLatinTextFast(s, AToken) = 0 then if AnsiCompareText(s, AToken) = 0 then
break break
else if UTF8CompareLatinTextFast(Copy(s, 1, Len), AToken) = 0 then begin else if AnsiCompareText(Copy(s, 1, Len), AToken) = 0 then begin
Inc(NumMaybe); Inc(NumMaybe);
IdxMaybe := i; IdxMaybe := i;
end; end;