Skip to content

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

@JedrzejczykRobert

Description

@JedrzejczykRobert

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]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions