Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
Denys-Bushulyak committed Feb 3, 2015
1 parent 05e77a7 commit 2a500bf
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions chain.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,17 @@ function Chain(items) {
var _index = 0;

var _items = items.slice(0) || [];
var _hashTable = [];

//Wraping all arrays at items into chain
for (var index in _items) {

var hash = getHash(_items[index]);
_hashTable[hash] = _items[index];

for (var i in _items[index]) {
if (Array.isArray(_items[index][i])) {
_items[index][i] = Chain(_items[index][i]);
}
}
}

function getHash(obj) {
var hash = btoa(JSON.stringify(obj));

return hash.substr(Math.random() * 100, 5);
}

function _next() {
_index++;

Expand Down Expand Up @@ -103,10 +93,6 @@ function Chain(items) {
return _current();
}

function _getHashTable() {
return _hashTable;
}

return {
next : _next,
prev : _prev,
Expand All @@ -120,7 +106,6 @@ function Chain(items) {
goToEnd : _goToEnd,
getItems : _getItems,
beginFrom : _beginFrom,
getIndex : _getIndex,
getHashTable: _getHashTable
getIndex : _getIndex
};
}

0 comments on commit 2a500bf

Please sign in to comment.