diff options
author | Phil Hughes <me@iamphill.com> | 2018-08-02 10:43:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-08-02 10:43:31 +0300 |
commit | cc04a18d655ed0cfa7e5a4f0eb7971c73325afd8 (patch) | |
tree | 19216bd880035da1acbe027fbac1796c8c6b87ae /app/assets/javascripts/ide/stores/utils.js | |
parent | 3f4aaea26c65391098e9e424c4550493a1c525cb (diff) |
improve performance of deleting
Diffstat (limited to 'app/assets/javascripts/ide/stores/utils.js')
-rw-r--r-- | app/assets/javascripts/ide/stores/utils.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js index 5dc3e2c202d..6d4941e9c32 100644 --- a/app/assets/javascripts/ide/stores/utils.js +++ b/app/assets/javascripts/ide/stores/utils.js @@ -172,8 +172,7 @@ export const sortTree = sortedTree => ) .sort(sortTreesByTypeAndName); -export const filePathMatches = (f, path) => - f.path.replace(new RegExp(`${f.name}$`), '').indexOf(`${path}/`) === 0; +export const filePathMatches = (filePath, path) => filePath.indexOf(`${path}/`) === 0; export const getChangesCountForFiles = (files, path) => - files.filter(f => filePathMatches(f, path)).length; + files.filter(f => filePathMatches(f.path, path)).length; |