general cleanup (#256)

This patch:
- fixes multimap implementation to work properly in node
- moves ESTreeWalker from third-party into utils/doclint. ESTreeWalker
  license is compliant with Apache2.0.
This commit is contained in:
Andrey Lushnikov
2017-08-14 21:16:59 -07:00
committed by GitHub
parent 13e8580a34
commit 0a1294c7ee
5 changed files with 3 additions and 52 deletions

View File

@@ -94,13 +94,6 @@ class Multimap {
this._map.delete(key);
}
/**
* @return {!Array<K>}
*/
keysArray() {
return this._map.keysArray();
}
/**
* @param {K} key
* @return {?V} value
@@ -124,9 +117,8 @@ class Multimap {
*/
valuesArray() {
let result = [];
let keys = this.keysArray();
for (let i = 0; i < keys.length; ++i)
result.pushAll(this.get(keys[i]).valuesArray());
for (let key of this._map.keys())
result.push(...Array.from(this._map.get(key).values()));
return result;
}