Util cleanup
This commit is contained in:
@@ -117,12 +117,7 @@ class LayoutLink {
|
||||
}
|
||||
|
||||
for (let hop of this.path) {
|
||||
let links = this.linksByPos_.get(hop);
|
||||
if (!links) {
|
||||
links = [];
|
||||
this.linksByPos_.set(hop, links);
|
||||
}
|
||||
links.push(this);
|
||||
getOrSet(this.linksByPos_, hop, []).push(this);
|
||||
}
|
||||
|
||||
console.log(iter);
|
||||
|
||||
17
StringMap.js
Normal file
17
StringMap.js
Normal file
@@ -0,0 +1,17 @@
|
||||
class StringMap extends Map {
|
||||
has(key) {
|
||||
return super.has(key.toString());
|
||||
}
|
||||
|
||||
get(key) {
|
||||
return super.get(key.toString());
|
||||
}
|
||||
|
||||
set(key, value) {
|
||||
return super.set(key.toString(), value);
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
return super.delete(key.toString());
|
||||
}
|
||||
}
|
||||
18
utils.js
18
utils.js
@@ -25,20 +25,4 @@ function intersects(set1, set2) {
|
||||
return false;
|
||||
}
|
||||
|
||||
class StringMap extends Map {
|
||||
has(key) {
|
||||
return super.has(key.toString());
|
||||
}
|
||||
|
||||
get(key) {
|
||||
return super.get(key.toString());
|
||||
}
|
||||
|
||||
set(key, value) {
|
||||
return super.set(key.toString(), value);
|
||||
}
|
||||
|
||||
delete(key) {
|
||||
return super.delete(key.toString());
|
||||
}
|
||||
}
|
||||
<!--# include file="StringMap.js" -->
|
||||
|
||||
Reference in New Issue
Block a user