persistent-hash-trie
Advanced tools
Comparing version 0.2.3 to 0.2.4
@@ -17,6 +17,9 @@ 'use strict' | ||
assoc(100), | ||
assoc(1000), | ||
dissoc(1), | ||
dissoc(10), | ||
dissoc(100), | ||
dissoc(1000), | ||
@@ -26,2 +29,3 @@ has(1), | ||
has(100), | ||
has(1000), | ||
@@ -31,8 +35,10 @@ get(1), | ||
get(100), | ||
get(1000), | ||
transient(1), | ||
transient(10), | ||
transient(100) | ||
transient(100), | ||
transient(1000) | ||
] | ||
_.each(suites, run) |
@@ -10,9 +10,8 @@ 'use strict' | ||
log('Results:') | ||
this.map(function(results){ | ||
log(results.name + ' : ' + results.count + ' ± ' + results.stats.rme + '%') | ||
}) | ||
log('~~~~~~~~~~~~~~~~~~~~~~~~~~~~') | ||
} | ||
module.exports = print | ||
module.exports = print |
@@ -5,3 +5,3 @@ | ||
"description": "Pure string:val storage, using structural sharing", | ||
"version": "0.2.3", | ||
"version": "0.2.4", | ||
"main": "src/persistent-hash-trie.js", | ||
@@ -13,5 +13,2 @@ "scripts": { | ||
}, | ||
"dependencies": { | ||
"string-hash": "1.1.0" | ||
}, | ||
"devDependencies": { | ||
@@ -18,0 +15,0 @@ "mocha": "1.8.1", |
@@ -51,2 +51,13 @@ 'use strict' | ||
// hash function for strings, based on Java's String.hashCode: | ||
// http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html#hashCode() | ||
var hash = function(str){ | ||
var h = 0 | ||
var l = str.length | ||
for ( var i = 0; i < l; i += 1 ) | ||
h += str.charCodeAt(i) * 31 * l - i | ||
return h | ||
} | ||
// to allow hooks for other implementations/tests to override the default | ||
@@ -58,3 +69,4 @@ // hash and equality functions (which are the necessary ones for creating | ||
eq : function(a, b){ return a === b }, | ||
hash: require('string-hash') | ||
hash: hash | ||
} | ||
@@ -61,0 +73,0 @@ |
@@ -10,3 +10,3 @@ 'use strict' | ||
var log = function(msg){ | ||
console && typeof console.log == 'function' && console.log(msg) | ||
console && typeof console.log === 'function' && console.log(msg) | ||
} | ||
@@ -13,0 +13,0 @@ |
Sorry, the diff of this file is not supported yet
0
2518
129781
- Removedstring-hash@1.1.0
- Removedstring-hash@1.1.0(transitive)