Skip to content

Commit

Permalink
Tweak BufferUnpacker::unpack[U]Int16()
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Leonovich committed Apr 30, 2018
1 parent 047badd commit a0ac282
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/BufferUnpacker.php
Expand Up @@ -423,8 +423,8 @@ private function unpackUint16()
}

$hi = \ord($this->buffer[$this->offset]);
$lo = \ord($this->buffer[$this->offset + 1]);
$this->offset += 2;
$lo = \ord($this->buffer[++$this->offset]);
++$this->offset;

return $hi << 8 | $lo;
}
Expand Down Expand Up @@ -472,8 +472,8 @@ private function unpackInt16()
}

$hi = \ord($this->buffer[$this->offset]);
$lo = \ord($this->buffer[$this->offset + 1]);
$this->offset += 2;
$lo = \ord($this->buffer[++$this->offset]);
++$this->offset;

return $hi > 0x7f ? $hi << 8 | $lo - 0x10000 : $hi << 8 | $lo;
}
Expand Down

0 comments on commit a0ac282

Please sign in to comment.