Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
99dc4430
Commit
99dc4430
authored
Mar 14, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve performance slightly
still has a massive bottleneck somewhere [ci skip]
parent
ea109251
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
19 deletions
+8
-19
ee/app/assets/javascripts/ide/stores/actions/tree.js
ee/app/assets/javascripts/ide/stores/actions/tree.js
+0
-2
ee/app/assets/javascripts/ide/stores/getters.js
ee/app/assets/javascripts/ide/stores/getters.js
+8
-17
No files found.
ee/app/assets/javascripts/ide/stores/actions/tree.js
View file @
99dc4430
...
...
@@ -5,10 +5,8 @@ import service from '../../services';
import
*
as
types
from
'
../mutation_types
'
;
import
router
from
'
../../ide_router
'
;
import
{
setPageTitle
,
findEntry
,
createTemp
,
createOrMergeEntry
,
}
from
'
../utils
'
;
import
FilesDecoratorWorker
from
'
../workers/files_decorator_worker
'
;
...
...
ee/app/assets/javascripts/ide/stores/getters.js
View file @
99dc4430
...
...
@@ -17,26 +17,17 @@ export const addedFiles = state => changedFilesMap(state).filter(f => f.tempFile
export
const
modifiedFiles
=
state
=>
changedFilesMap
(
state
).
filter
(
f
=>
!
f
.
tempFile
);
export
const
treeList
=
(
state
)
=>
{
const
tree
=
state
.
trees
[
'
root/testing-123/master
'
];
const
tree
=
state
.
trees
[
`
${
state
.
currentProjectId
}
/master`
];
if
(
!
tree
)
return
[];
const
map
=
(
arr
)
=>
{
if
(
!
arr
.
tree
.
length
)
return
[];
return
sortTree
(
arr
.
tree
.
reduce
((
acc
,
key
)
=>
{
const
entity
=
state
.
entries
[
key
];
if
(
entity
)
{
return
acc
.
concat
({
...
entity
,
tree
:
map
(
entity
),
});
}
return
acc
;
},
[]));
};
const
map
=
arr
=>
sortTree
(
arr
.
tree
.
map
((
key
)
=>
{
const
entity
=
state
.
entries
[
key
];
return
{
...
entity
,
tree
:
!
arr
.
tree
.
length
?
[]
:
map
(
entity
),
};
}));
return
map
(
tree
);
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment