Spelt / ZXing.Delphi

ZXing Barcode Scanning object Pascal Library for Delphi VCL and Delphi Firemonkey
Apache License 2.0
479 stars 204 forks source link

Small bug - Count for Move must multiplied by element size in bytes #143

Closed JedrzejczykRobert closed 1 year ago

JedrzejczykRobert commented 1 year ago

file: ZXing.ReadResult

line: 339, 340

current:

  Move(oldPoints[0], newPoints[0], Length(oldPoints));
  Move(newPoints[0], newPoints[Length(oldPoints)], Length(newPoints));

should be:

  Move(oldPoints[0], allPoints[0], Length(oldPoints) * sizeof(allPoints[0]));
  Move(newPoints[0], allPoints[Length(oldPoints)], Length(newPoints) * sizeof(allPoints[0]));

or better:

  TArray.Copy<IResultPoint>(oldPoints, allPoints, 0, 0, Length(oldPoints));
  TArray.Copy<IResultPoint>(newPoints, allPoints, 0, Length(oldPoints), Length(newPoints));

or all function code can be minimized to:

FResultPoints := TArray.Concat<IResultPoint>([FResultPoints, newPoints]);

wwq0071 commented 1 year ago

the function TArray.Concat does not existed in the 10.2.3 version

Spelt commented 1 year ago

Yes its better to roll this one back. Op 24 aug. 2023 om 04:59 heeft wwq0071 @.***> het volgende geschreven: the function TArray.Concat does not existed in the 10.2.3 version

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you modified the open/close state.Message ID: @.***>

Spelt commented 1 year ago

I have updated this one.

Thanks for your feedback!

Edward

On 25 Aug 2023, at 13:22, Edward Spelt @.***> wrote:

Yes its better to roll this one back.

Op 24 aug. 2023 om 04:59 heeft wwq0071 @.***> het volgende geschreven:



the function TArray.Concat does not existed in the 10.2.3 version

— Reply to this email directly, view it on GitHub https://github.com/Spelt/ZXing.Delphi/issues/143#issuecomment-1690916894, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAS3VPC437R6A5375KKAXLXW27QBANCNFSM6AAAAAAZ23G4OY. You are receiving this because you modified the open/close state.