Lazarus_Hashing icon indicating copy to clipboard operation
Lazarus_Hashing copied to clipboard

small optim here?

Open Alexey-T opened this issue 2 years ago • 1 comments

function THasherList.FindClass(Name: String; out AClass: THasherClass): Boolean;
var Index: Integer;
begin
  Name := LowerCase(Name);
  Index := FList.IndexOf(Name);

FList.IndexOf(LowerCase(Name)) and make Name the const-param.

Alexey-T avatar Nov 26 '22 14:11 Alexey-T

While this is a nice idea for how the code works now I have a plan to extend functionality of FindClass() if people find it useful.

The plan is to find THasherClasses even when "Name" is not an exact match - has unnecessary spaces, hyphens or slashes. So for example if the registered name is "CRC-16 KERMITT" then calling FindClass(" CRC16/KERMITT ") would also find this class.

PascalVault avatar Nov 26 '22 16:11 PascalVault