mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[git] IDEA-117500 Don't copy, just wrap in unmodifiable
This commit is contained in:
@@ -23,7 +23,6 @@ import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashSet;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -49,20 +48,14 @@ public final class GitBranchesCollection {
|
||||
myLocalBranches = localBranches;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the copy of local branches set.
|
||||
*/
|
||||
@NotNull
|
||||
public Collection<GitLocalBranch> getLocalBranches() {
|
||||
return new HashSet<GitLocalBranch>(myLocalBranches);
|
||||
return Collections.unmodifiableCollection(myLocalBranches);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the copy of remote branches set.
|
||||
*/
|
||||
@NotNull
|
||||
public Collection<GitRemoteBranch> getRemoteBranches() {
|
||||
return new HashSet<GitRemoteBranch>(myRemoteBranches);
|
||||
return Collections.unmodifiableCollection(myRemoteBranches);
|
||||
}
|
||||
|
||||
public GitLocalBranch findLocalBranch(@NotNull final String name) {
|
||||
|
||||
Reference in New Issue
Block a user