neo4j-php / Bolt

PHP library to provide connectivity to graph database over TCP socket with Bolt specification
https://packagist.org/packages/stefanak-michal/bolt
MIT License
73 stars 10 forks source link

Optimize small integer unpack #83

Closed stefanak-michal closed 2 years ago

stefanak-michal commented 2 years ago

https://github.com/neo4j-php/Bolt/blob/1efed4ba3f1796d37d2715998e5411759f580607/src/PackStream/v1/Unpacker.php#L255-L258

You can do it better than two if's. It's just a number between -16 and 127.

https://7687.org/packstream/packstream-specification-1.html#integer

stefanak-michal commented 2 years ago

87