Skip to content

Commit 6305619

Browse files
committed
💄
1 parent 7b10197 commit 6305619

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/Data/QRMatrix.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,8 @@ public function setLogoSpace(int $width, int $height = null, int $startX = null,
578578
$startY = ((($startY !== null) ? $startY : ($length - $height) / 2) + $qz);
579579

580580
// clear the space
581-
foreach($this->matrix as $y => $row){
582-
/** @SuppressWarnings(PHPMD.UnusedLocalVariable) */
583-
foreach($row as $x => $val){
581+
for($y = 0; $y < $this->moduleCount; $y++){
582+
for($x = 0; $x < $this->moduleCount; $x++){
584583
// out of bounds, skip
585584
if($x < $start || $y < $start ||$x >= $end || $y >= $end){
586585
continue;

src/Decoder/Binarizer.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -204,16 +204,12 @@ private function getHistogramBlackMatrix(int $width, int $height):BitMatrix{
204204
* @see http://groups.google.com/group/zxing/browse_thread/thread/d06efa2c35a7ddc0
205205
*/
206206
private function calculateBlackPoints(int $subWidth, int $subHeight, int $width, int $height):array{
207-
$blackPoints = array_fill(0, $subHeight, 0);
208-
209-
/** @SuppressWarnings(PHPMD.UnusedLocalVariable) */
210-
foreach($blackPoints as $key => $point){
211-
$blackPoints[$key] = array_fill(0, $subWidth, 0);
212-
}
207+
$blackPoints = [];
213208

214209
for($y = 0; $y < $subHeight; $y++){
215-
$yoffset = ($y << self::BLOCK_SIZE_POWER);
216-
$maxYOffset = ($height - self::BLOCK_SIZE);
210+
$yoffset = ($y << self::BLOCK_SIZE_POWER);
211+
$maxYOffset = ($height - self::BLOCK_SIZE);
212+
$blackPoints[$y] = [];
217213

218214
if($yoffset > $maxYOffset){
219215
$yoffset = $maxYOffset;

0 commit comments

Comments
 (0)