Skip to content

Commit

Permalink
Merge pull request #66 from BridgeAR/add-offset
Browse files Browse the repository at this point in the history
Add offset
  • Loading branch information
hildjj authored Mar 12, 2018
2 parents 387d1c4 + bbb2287 commit f35349c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/encoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Encoder extends stream.Transform {
}
const b4 = new Buffer(4)
b4.writeFloatBE(obj)
if (b4.readFloatBE() === obj) {
if (b4.readFloatBE(0) === obj) {
return this._pushUInt8(FLOAT) && this.push(b4)
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ exports.writeHalf = function writeHalf(buf, half) {

const u32 = new Buffer(4)
u32.writeFloatBE(half)
const u = u32.readUInt32BE()
const u = u32.readUInt32BE(0)

// if ((u32.u & 0x1FFF) == 0) { /* worth trying half */

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"contributors": [
"Patrick Gansterer <[email protected]> (http://paroga.com/)",
"Artyom Yagilev <[email protected]> (http://scorpi.org/)",
"Denis Lapaev <[email protected]> (http://lapaev.me/)"
"Denis Lapaev <[email protected]> (http://lapaev.me/)",
"Ruben Bridgewater <[email protected]>"
],
"ava": {
"files": [
Expand Down

0 comments on commit f35349c

Please sign in to comment.