Skip to content

Commit 1a74b25

Browse files
committed
Use native array_fill() in PHP writer where possible
Change-Id: I69bc467448d4bd736dab65b60f6d3b8b6aee0929
1 parent 0e1b92e commit 1a74b25

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/Writer/PHP.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,7 @@ protected function finish(): void {
183183
$len = $count + $count;
184184
$final .= pack( 'VV', $this->pos, $len );
185185

186-
$hashtable = [];
187-
for ( $u = 0; $u < $len; ++$u ) {
188-
$hashtable[$u] = [ 'h' => 0, 'p' => 0 ];
189-
}
186+
$hashtable = array_fill( 0, $len, [ 'h' => 0, 'p' => 0 ] );
190187

191188
// Fill the hashtable, using the next empty slot if the hashed slot
192189
// is taken.

0 commit comments

Comments
 (0)