From 0919bf58f50e1c43134ce8055cc8e9f73077ce21 Mon Sep 17 00:00:00 2001 From: hlq07 Date: Tue, 29 May 2018 05:34:50 +0800 Subject: [PATCH] improve performance --- .../presenter/newitems/NewItemBuilder.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/NewItemBuilder.java b/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/NewItemBuilder.java index 7bbaad8..69d489e 100644 --- a/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/NewItemBuilder.java +++ b/app/src/main/java/org/cutem/cutecalendar/presenter/newitems/NewItemBuilder.java @@ -13,10 +13,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import java.io.IOException; -import java.util.Calendar; -import java.util.Collection; -import java.util.HashMap; -import java.util.Objects; +import java.util.*; import static org.cutem.cutecalendar.model.TodoItem.*; @@ -117,8 +114,9 @@ public abstract class NewItemBuilder extends VBox { protected boolean autoCheck() { - for (String key : mAutoSet.keySet()) { - String val = mAutoSet.get(key).getValue(); + for (Map.Entry e : mAutoSet.entrySet()) { + String key = e.getKey(); + String val = e.getValue().getValue(); if (!checkFormation(key, val)) { String info = mAutoAlertInfo.get(key); showAlert(info); @@ -148,8 +146,9 @@ public abstract class NewItemBuilder extends VBox { protected TodoItemFactory autoBuild() { TodoItemFactory factory = new TodoItemFactory(); - for (String key : mAutoSet.keySet()) { - String val = mAutoSet.get(key).getValue(); + for (Map.Entry e : mAutoSet.entrySet()) { + String key = e.getKey(); + String val = e.getValue().getValue(); factory.stringProperties(key, val); }