Skip to content
Browse files

There is no case where the check in getItems is required other than a…

…n infinite number - so let's use isFinite()
  • Loading branch information...
1 parent 17b3be3 commit 3723d245b9565c8f5cb2e306b8be0ff52305cbb9 @fb55 fb55 committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/nodepie.js
View
4 lib/nodepie.js
@@ -509,7 +509,7 @@ NodePie.prototype.getItems = function(start, length){
if(start >= quantity){
start = quantity-1;
- if(start<0){
+ if(start < 0){
start = 0;
}
}
@@ -532,7 +532,7 @@ NodePie.prototype.getItems = function(start, length){
* Fetches a NodePie.Item object from defined index or false if out of bounds
**/
NodePie.prototype.getItem = function(i){
- i = i && !isNaN(i) && parseInt(Math.abs(i), 10) || 0;
+ i = i && !isNaN(i) && isFinite(i) || 0;
if(this._items[i]){
return this._items[i];

0 comments on commit 3723d24

Please sign in to comment.
Something went wrong with that request. Please try again.