Skip to content

Commit

Permalink
fix: use indexof inside onRemoveFile
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Apr 27, 2021
1 parent c62d11c commit 97ba9f8
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions lib/paths-cache.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,8 @@ export default class PathsCache extends EventEmitter {
const filePaths = this._filePathsByProjectDirectory.get(projectDirectory.path)

// delete the removed file
for (let iFile = 0; iFile < filePaths.length; iFile++) {
const file = filePaths[iFile]
if (file === removedFile) {
delete filePaths[iFile]
break
}
}
const fileIndex = filePaths.indexOf(removedFile)
delete filePaths[fileIndex]
this._filePathsByProjectDirectory.set(projectDirectory.path, filePaths)
}

Expand Down

0 comments on commit 97ba9f8

Please sign in to comment.