Skip to content

Commit 8e178c5

Browse files
Support the insertion of 0
I use btree-js when debugging my C++ btree code to make sure everything is operating correctly and 0 is a number in my current testing model
1 parent 3c570b9 commit 8e178c5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

assets/js/btree-node.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ BTreeNode.prototype.traverse = function(value, strict) {
3030

3131
BTreeNode.prototype.insert = function(value){
3232

33-
var int = parseInt(value) || 0;
34-
if ( int <= 0 || int > 1000000000000 ) {
33+
var int = parseInt(value);
34+
35+
if ( typeof value !== "number" || int > 1000000000000 ) {
3536
alert('Please enter a valid integer.');
3637
return false;
3738
}

0 commit comments

Comments
 (0)