Comparing version 0.5.2 to 0.5.3
@@ -75,4 +75,4 @@ /* | ||
if ( ( me.bmlen <= v ) || ( v >= range ) ) return 0; | ||
// see add for comments | ||
return bpower[ v & 7 ] & me.bitmap[ v >>> 3 ]; | ||
// see #add | ||
return bpower[ v & 7 ] & me.bitmap[ v >>> 3 ] ? 1 : 0; | ||
}; | ||
@@ -79,0 +79,0 @@ |
{ | ||
"name": "toni" | ||
, "version": "0.5.2" | ||
, "version": "0.5.3" | ||
, "description": "Toni, a simple and efficient bitmap implementation for positive integer sets (max 32 bits), with no element repetition, using bitwise operations and a Buffer. Modifying a single bit instead of an entire byte, obviously saves 87.5% of Buffer space, but it also implies a gain greater than 200% in performances, for accessing values, when it was used with big integer ranges." | ||
@@ -5,0 +5,0 @@ , "homepage": "https://github.com/rootslab/toni" |
@@ -111,3 +111,3 @@ ### Toni | ||
* Check for item presence in the set. | ||
* It returns a positive number if item is present, 0 otherwise. | ||
* It returns 1 if item is present, 0 otherwise. | ||
*/ | ||
@@ -114,0 +114,0 @@ Toni#chk : function ( Number value ) : Number |
@@ -28,8 +28,8 @@ /* | ||
assert.ok( toni.chk( 1 ) ); | ||
assert.ok( toni.chk( 23 ) ); | ||
assert.ok( toni.chk( 34 ) ); | ||
assert.ok( toni.chk( 13 ) ); | ||
assert.ok( toni.chk( 0 ) ); | ||
assert.ok( toni.chk( 85 ) ); | ||
assert.ok( toni.chk( 1 ) === 1 ); | ||
assert.ok( toni.chk( 23 ) === 1 ); | ||
assert.ok( toni.chk( 34 ) === 1 ); | ||
assert.ok( toni.chk( 13 ) === 1 ); | ||
assert.ok( toni.chk( 0 ) === 1 ); | ||
assert.ok( toni.chk( 85 ) === 1 ); | ||
@@ -36,0 +36,0 @@ log( '- check for items out of range..' ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25047