Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2018-08-02 10:43:31 +0300
committerPhil Hughes <me@iamphill.com>2018-08-02 10:43:31 +0300
commitcc04a18d655ed0cfa7e5a4f0eb7971c73325afd8 (patch)
tree19216bd880035da1acbe027fbac1796c8c6b87ae /app/assets/javascripts/ide/stores/utils.js
parent3f4aaea26c65391098e9e424c4550493a1c525cb (diff)
improve performance of deleting
Diffstat (limited to 'app/assets/javascripts/ide/stores/utils.js')
-rw-r--r--app/assets/javascripts/ide/stores/utils.js5
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;