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
uses
Classes, Types, SysUtils, contnrs, Math, Maps, LazClasses, LazFileUtils,
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif}, LazUTF8, lazCollections,
Classes, Types, SysUtils, Contnrs, Math,
// LazUtils
Maps, LazClasses, LazFileUtils, LazUTF8, LazCollections,
{$ifdef FORCE_LAZLOGGER_DUMMY} LazLoggerDummy {$else} LazLoggerBase {$endif},
// FpDebug
FpDbgUtil, FpDbgInfo, FpDbgDwarfConst, FpDbgCommon, FpDbgDwarfCFI,
FpDbgLoader, FpImgReaderBase, FpdMemoryTools, FpErrorMessages, DbgIntfBaseTypes;
@ -5194,7 +5196,7 @@ function TDwarfCompilationUnit.GetLineAddressMap(const AFileName: String): PDWar
if Result <> -1 then Exit;
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;
Result := -1;
end;

View File

@ -18,7 +18,7 @@ uses
// LCL
StdCtrls, ImgList, Graphics,
// LazUtils
LazUTF8, LazFileUtils;
LazFileUtils;
type
TCmpStrType = (
@ -54,7 +54,7 @@ begin
for i:=0 to List.Count-1 do begin
case Cmp of
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);
end;
end;

View File

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

View File

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

View File

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

View File

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

View File

@ -275,9 +275,9 @@ begin
end else begin
while i > -1 do begin
s := fCompletions[i];
if UTF8CompareLatinTextFast(s, AToken) = 0 then
if AnsiCompareText(s, AToken) = 0 then
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);
IdxMaybe := i;
end;