- for(ProfileEntry e : entries) {
- if (DebugPolicy.DEBUG_PROFILE_OBSERVER_PERFORM)
- System.out.println("Apply profile entry: " + e);
- e.apply(ProfileObserver.this);
+
+ long t0 = System.nanoTime();
+
+ if (updateAll) {
+ for(ProfileEntry e : entries) {
+ if (DebugPolicy.DEBUG_PROFILE_OBSERVER_PERFORM)
+ System.out.println("Apply profile entry: " + e);
+ e.apply(ProfileObserver.this);
+ }
+ updateAll = false;
+ updates.clear();
+ } else {
+ List<Pair<Style, Object>> updatesCopy = new ArrayList<>(updates);
+ updates.clear();
+ for (Pair<Style, Object> update : updatesCopy) {
+ Style style = update.first;
+ Object item = update.second;
+
+ style.apply2(item, ProfileObserver.this);
+ }