🔥 Remove unneeded WeakSet

This commit is contained in:
Antonio Scandurra
2016-05-25 17:19:59 +02:00
parent d8564add7a
commit aefcbcda47

View File

@@ -10,7 +10,6 @@ export default class FileRecoveryService {
this.recoveryDirectory = recoveryDirectory
this.recoveryFilesByFilePath = new Map()
this.recoveryFilesByWindow = new WeakMap()
this.observedWindows = new WeakSet()
}
willSavePath (window, path) {
@@ -31,10 +30,6 @@ export default class FileRecoveryService {
console.log(`Couldn't retain ${recoveryFile.recoveryPath}. Code: ${err.code}. Message: ${err.message}`)
}
if (!this.observedWindows.has(window)) {
this.observedWindows.add(window)
}
if (!this.recoveryFilesByWindow.has(window)) {
this.recoveryFilesByWindow.set(window, new Set())
}
@@ -76,7 +71,6 @@ export default class FileRecoveryService {
}
didCloseWindow (window) {
this.observedWindows.delete(window)
this.recoveryFilesByWindow.delete(window)
}
}