Lazarus_Hashing
Lazarus_Hashing copied to clipboard
small optim here?
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.
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.