Skip to content

Commit e41fa36

Browse files
committed
fix: use normal loop and object keys in destroy
1 parent d030434 commit e41fa36

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/minimap-find-and-replace-binding.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,14 @@ class MinimapFindAndReplaceBinding {
2424
}
2525

2626
destroy () {
27-
let id
28-
for (id in this.subscriptionsByMarkerId) {
29-
const sub = this.subscriptionsByMarkerId[id]; sub.dispose()
27+
const subscriptionsByMarkerIdKeys = Object.keys(this.subscriptionsByMarkerId)
28+
for (let i = 0, len = subscriptionsByMarkerIdKeys.length; i < len; i++) {
29+
this.subscriptionsByMarkerId[subscriptionsByMarkerIdKeys[i]].dispose()
3030
}
31-
for (id in this.decorationsByMarkerId) {
32-
const decoration = this.decorationsByMarkerId[id]; decoration.destroy()
31+
32+
const decorationsByMarkerIdKeys = Object.keys(this.decorationsByMarkerId)
33+
for (let i = 0, len = decorationsByMarkerIdKeys.length; i < len; i++) {
34+
this.decorationsByMarkerId[decorationsByMarkerIdKeys[i]].destroy()
3335
}
3436

3537
this.subscriptions.dispose()

0 commit comments

Comments
 (0)