← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 19376: Analytics, minor performance improvement

 

------------------------------------------------------------
revno: 19376
committer: Lars Helge Overland <larshelge@xxxxxxxxx>
branch nick: dhis2
timestamp: Sat 2015-06-13 14:05:43 +0200
message:
  Analytics, minor performance improvement
modified:
  dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java'
--- dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-06-13 11:43:28 +0000
+++ dhis-2/dhis-services/dhis-service-analytics/src/main/java/org/hisp/dhis/analytics/data/DefaultAnalyticsService.java	2015-06-13 12:05:43 +0000
@@ -1308,6 +1308,8 @@
     private Map<String, String> getUidNameMap( List<DimensionalObject> dimensions, boolean hierarchyMeta, DisplayProperty displayProperty )
     {
         Map<String, String> map = new HashMap<>();
+        
+        Calendar calendar = PeriodType.getCalendar();
 
         for ( DimensionalObject dimension : dimensions )
         {
@@ -1319,11 +1321,9 @@
             // Insert UID and name into map
             // -----------------------------------------------------------------
 
-            Calendar calendar = PeriodType.getCalendar();
-
             for ( NameableObject object : items )
             {
-                if ( !calendar.isIso8601() && Period.class.isInstance( object ) )
+                if ( Period.class.isInstance( object ) && !calendar.isIso8601() )
                 {
                     Period period = (Period) object;
                     DateTimeUnit dateTimeUnit = calendar.fromIso( period.getStartDate() );