Skip to content

Commit

Permalink
Increment nElement
Browse files Browse the repository at this point in the history
Looks like nElement never gets incremented, yet it is used in the `isEmpty` function. As a result, `isEmpty` would always return true.
  • Loading branch information
Nate Good committed Aug 17, 2015
1 parent 7621acc commit 98aeab6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/natural/util/bag.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function Bag() {

Bag.prototype.add = function(element) {
this.dictionary.push(element);
this.nElement++;
return this;
};

Expand Down

0 comments on commit 98aeab6

Please sign in to comment.