Skip to content

Commit

Permalink
Use precomputed constants. (Minor performance tweak)
Browse files Browse the repository at this point in the history
  • Loading branch information
cynthia authored and paroga committed Sep 14, 2016
1 parent d08b62a commit 587cf48
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cbor.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
*/

(function(global, undefined) { "use strict";
var POW_2_24 = Math.pow(2, -24),
POW_2_32 = Math.pow(2, 32),
POW_2_53 = Math.pow(2, 53);
var POW_2_24 = 5.960464477539063e-8,
POW_2_32 = 4294967296,
POW_2_53 = 9007199254740992;

function encode(value) {
var data = new ArrayBuffer(256);
Expand Down

0 comments on commit 587cf48

Please sign in to comment.