ItEr22S12CUVistaRecursosTempoPorProxectoItEr21S07: Caching the realInterval because it's going to be called a lot of times.
This commit is contained in:
parent
2651fc6d85
commit
89eef4534a
1 changed files with 8 additions and 1 deletions
|
|
@ -59,8 +59,14 @@ public class TimeTracker {
|
|||
return detailsSecondLevelCached;
|
||||
}
|
||||
|
||||
private Interval realIntervalCached;
|
||||
|
||||
private Interval getRealInterval() {
|
||||
return getTimeTrackerState().getRealIntervalFor(interval);
|
||||
if (realIntervalCached == null) {
|
||||
realIntervalCached = getTimeTrackerState().getRealIntervalFor(
|
||||
interval);
|
||||
}
|
||||
return realIntervalCached;
|
||||
}
|
||||
|
||||
private TimeTrackerState getTimeTrackerState() {
|
||||
|
|
@ -90,6 +96,7 @@ public class TimeTracker {
|
|||
private void clearDetailLevelDependantData() {
|
||||
datesMapper = null;
|
||||
detailsFirstLevelCached = detailsSecondLevelCached = null;
|
||||
realIntervalCached = null;
|
||||
}
|
||||
|
||||
public IDatesMapper getMapper() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue