~ubuntu-branches/ubuntu/trusty/gnome-shell/trusty

« back to all changes in this revision

Viewing changes to js/misc/hash.js

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-07-31 21:29:20 UTC
  • mfrom: (1.1.51)
  • Revision ID: package-import@ubuntu.com-20130731212920-mz92zheiqgq2ggd1
Tags: 3.8.4-0ubuntu1
* New upstream release.
* debian/patches/git-dont-crash-for-unstaged-widgets.patch:
  - Dropped, applied in new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
 
59
59
    _init: function(iterable) {
60
60
        this._pool = { };
 
61
        this._size = 0;
61
62
 
62
63
        if (iterable) {
63
64
            for (let i = 0; i < iterable.length; i++) {
99
100
            node.value = value;
100
101
        } else {
101
102
            this._pool[hash] = { key: key, value: value };
 
103
            this._size++;
102
104
        }
103
105
    },
104
106
 
108
110
 
109
111
        if (node && _sameValue(node.key, key)) {
110
112
            delete this._pool[hash];
 
113
            this._size--;
111
114
            return [node.key, node.value];
112
115
        } else {
113
116
            return [null, null];
136
139
    },
137
140
 
138
141
    size: function() {
139
 
        return Object.getOwnPropertyNames(this._pool).length;
 
142
        return this._size;
140
143
    },
141
144
});