Просмотр исходного кода

Decaf cleanup: remove Array.from()

Eric Mc Sween 6 лет назад
Родитель
Сommit
6c020f6e54
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      libraries/metrics/index.js

+ 3 - 2
libraries/metrics/index.js

@@ -1,6 +1,5 @@
 /*
  * decaffeinate suggestions:
- * DS101: Remove unnecessary use of Array.from
  * DS102: Remove unnecessary code created because of implicit returns
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
@@ -228,6 +227,8 @@ module.exports = Metrics = {
   timeAsyncMethod: require('./timeAsyncMethod'),
 
   close() {
-    return Array.from(destructors).map(func => func())
+    for (const func of destructors) {
+      func()
+    }
   }
 }