mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[hg]: return copy of ignored files to be thread safe, optimize size
This commit is contained in:
@@ -153,7 +153,7 @@ public class HgLocalIgnoredHolder implements Disposable {
|
||||
public Set<VirtualFile> getIgnoredFiles() {
|
||||
try {
|
||||
SET_LOCK.readLock().lock();
|
||||
return myIgnoredSet;
|
||||
return ContainerUtil.newHashSet(myIgnoredSet);
|
||||
}
|
||||
finally {
|
||||
SET_LOCK.readLock().unlock();
|
||||
@@ -173,6 +173,12 @@ public class HgLocalIgnoredHolder implements Disposable {
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return getIgnoredFiles().size();
|
||||
try {
|
||||
SET_LOCK.readLock().lock();
|
||||
return myIgnoredSet.size();
|
||||
}
|
||||
finally {
|
||||
SET_LOCK.readLock().unlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user