mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[vcs-log] do not unnecessary find branchRef by name when there is condition in cache with the same name
This commit is contained in:
@@ -134,11 +134,11 @@ public class ContainingBranchesGetter {
|
||||
PermanentGraph<Integer> graph = dataPack.getPermanentGraph();
|
||||
VcsLogRefs refs = dataPack.getRefsModel();
|
||||
|
||||
VcsRef branchRef = ContainerUtil.find(refs.getBranches(),
|
||||
vcsRef -> vcsRef.getRoot().equals(root) && vcsRef.getName().equals(branchName));
|
||||
if (branchRef == null) return Conditions.alwaysFalse();
|
||||
ContainedInBranchCondition condition = myConditions.get(root);
|
||||
if (condition == null || !condition.getBranch().equals(branchName)) {
|
||||
VcsRef branchRef = ContainerUtil.find(refs.getBranches(),
|
||||
vcsRef -> vcsRef.getRoot().equals(root) && vcsRef.getName().equals(branchName));
|
||||
if (branchRef == null) return Conditions.alwaysFalse();
|
||||
condition = new ContainedInBranchCondition(graph.getContainedInBranchCondition(
|
||||
Collections.singleton(myLogData.getCommitIndex(branchRef.getCommitHash(), branchRef.getRoot()))), branchName);
|
||||
myConditions.put(root, condition);
|
||||
|
||||
Reference in New Issue
Block a user