1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 20:44:11 +01:00

Death to for each.

This commit is contained in:
Kris Maglione
2014-02-24 19:03:49 -08:00
parent 78a6de9c3a
commit 5b38465a1c
20 changed files with 48 additions and 46 deletions

View File

@@ -501,22 +501,21 @@ var CommandHive = Class("CommandHive", Contexts.Hive, {
*/
cache: function cache() {
let self = this;
let { cache } = this.modules;
this.cached = true;
let cached = cache.get(this.cacheKey, function () {
self.cached = false;
let cached = cache.get(this.cacheKey, () => {
this.cached = false;
this.modules.moduleManager.initDependencies("commands");
let map = {};
for (let [name, cmd] in Iterator(self._map))
for (let [name, cmd] in Iterator(this._map))
if (cmd.sourceModule)
map[name] = { sourceModule: cmd.sourceModule, isPlaceholder: true };
let specs = [];
for (let cmd in values(self._list))
for each (let spec in cmd.parsedSpecs)
for (let cmd of this._list)
for (let spec of cmd.parsedSpecs)
specs.push(spec.concat(cmd.name));
return { map: map, specs: specs };