PascalVault / Lazarus_Hashing

Checksum & Hashing library for Lazarus
MIT License
18 stars 3 forks source link

little incorrect try/finally block #4

Closed Alexey-T closed 1 year ago

Alexey-T commented 1 year ago
  try
    Algo := FClass.Create;
    Algo.Update(@Test[0], 9);
    Res := Algo.Final;

    if Algo.Check = Res then Result := True;
  finally
    Algo.Free;
  end;

move line Algo:= BEFORE try, common practice, more correct.

Alexey-T commented 1 year ago

you did it OK here

  F := TBufferedFileStream.Create(Filename, fmOpenRead or fmShareDenyWrite);
  try
    Self.Update(F);
  finally  
    F.Free;
  end;
PascalVault commented 1 year ago

Thank you, updated