mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ConsoleHistory: small optimization
This commit is contained in:
@@ -136,7 +136,7 @@ public class ConsoleHistoryController {
|
||||
}
|
||||
|
||||
public boolean hasHistory() {
|
||||
return !getModel().getEntries().isEmpty();
|
||||
return !getModel().isEmpty();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@@ -555,7 +555,7 @@ public class ConsoleHistoryController {
|
||||
|
||||
private void saveHistory() {
|
||||
try {
|
||||
if (getModel().getEntries().isEmpty()) return;
|
||||
if (getModel().isEmpty()) return;
|
||||
if (myRootType.isHidden()) {
|
||||
saveHistoryOld();
|
||||
return;
|
||||
|
||||
@@ -96,6 +96,12 @@ class ConsoleHistoryModel extends SimpleModificationTracker {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
synchronized (myLock) {
|
||||
return myEntries.isEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
public int getHistorySize() {
|
||||
synchronized (myLock) {
|
||||
return myEntries.size();
|
||||
|
||||
Reference in New Issue
Block a user