diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-04-17 16:12:21 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-05-12 10:53:40 +0200 |
commit | 60997b58b88fd5e82663857f94ced7544d0220cc (patch) | |
tree | e2dccb7c23c2c5e26faac01d208ba47641b55599 /install/ui/src | |
parent | 68f04643d6022707e8ccac9f8b817542d9022119 (diff) | |
download | freeipa-60997b58b88fd5e82663857f94ced7544d0220cc.tar.gz freeipa-60997b58b88fd5e82663857f94ced7544d0220cc.tar.xz freeipa-60997b58b88fd5e82663857f94ced7544d0220cc.zip |
jQuery.ordered_map: remove map attribute
map attribute is redundant and not used.
Use `get` method instead.
Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Diffstat (limited to 'install/ui/src')
-rw-r--r-- | install/ui/src/libs/jquery.ordered-map.js | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/install/ui/src/libs/jquery.ordered-map.js b/install/ui/src/libs/jquery.ordered-map.js index 19f7b3dd5..b25dc3379 100644 --- a/install/ui/src/libs/jquery.ordered-map.js +++ b/install/ui/src/libs/jquery.ordered-map.js @@ -30,11 +30,10 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { */ that.keys = []; that.values = []; - that.map = {}; that.length = 0; that.get = function(key) { - return that.map[key]; + return that.values[that._key_indicies[key]]; }; that.put = function(key, value, position) { @@ -60,8 +59,6 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { } } - that.map[key] = value; - return that; }; @@ -111,11 +108,9 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { var i = that.get_key_index(key); if (i<0) return null; + var value = that.values[i]; that.keys.splice(i, 1); that.values.splice(i, 1); - - var value = that.map[key]; - delete that.map[key]; delete that._key_indicies[key]; that.length = that.keys.length; return value; @@ -124,7 +119,6 @@ jQuery.ordered_map = jQuery.fn.ordered_map = function(map) { that.empty = function() { that.keys = []; that.values = []; - that.map = {}; that._key_indicies = {}; that.length = that.keys.length; return that; |