improve performance

This commit is contained in:
hlq07 2018-05-29 05:34:50 +08:00
parent 9edd86dff5
commit 0919bf58f5
1 changed files with 7 additions and 8 deletions

View File

@ -13,10 +13,7 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import java.io.IOException; import java.io.IOException;
import java.util.Calendar; import java.util.*;
import java.util.Collection;
import java.util.HashMap;
import java.util.Objects;
import static org.cutem.cutecalendar.model.TodoItem.*; import static org.cutem.cutecalendar.model.TodoItem.*;
@ -117,8 +114,9 @@ public abstract class NewItemBuilder extends VBox {
protected boolean autoCheck() { protected boolean autoCheck() {
for (String key : mAutoSet.keySet()) { for (Map.Entry<String, ReadOnlyStringProperty> e : mAutoSet.entrySet()) {
String val = mAutoSet.get(key).getValue(); String key = e.getKey();
String val = e.getValue().getValue();
if (!checkFormation(key, val)) { if (!checkFormation(key, val)) {
String info = mAutoAlertInfo.get(key); String info = mAutoAlertInfo.get(key);
showAlert(info); showAlert(info);
@ -148,8 +146,9 @@ public abstract class NewItemBuilder extends VBox {
protected TodoItemFactory autoBuild() { protected TodoItemFactory autoBuild() {
TodoItemFactory factory = new TodoItemFactory(); TodoItemFactory factory = new TodoItemFactory();
for (String key : mAutoSet.keySet()) { for (Map.Entry<String, ReadOnlyStringProperty> e : mAutoSet.entrySet()) {
String val = mAutoSet.get(key).getValue(); String key = e.getKey();
String val = e.getValue().getValue();
factory.stringProperties(key, val); factory.stringProperties(key, val);
} }