diff flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java @ 3087:4a76da133144

Removed repeated x.size() calls from for loops. flys-artifacts/trunk@4684 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 18 Jun 2012 09:16:05 +0000
parents 8ad8a227d983
children 6c91e05a5f51
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Mon Jun 18 08:55:51 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/XYChartGenerator.java	Mon Jun 18 09:16:05 2012 +0000
@@ -283,7 +283,7 @@
      */
     public void debugDatasets(XYPlot plot) {
         logger.debug("Number of datasets: " + plot.getDatasetCount());
-        for (int i = 0; i < plot.getDatasetCount(); i++) {
+        for (int i = 0, P = plot.getDatasetCount(); i < P; i++) {
             if (plot.getDataset(i) == null) {
                 logger.debug("Dataset #" + i + " is null");
                 continue;
@@ -303,7 +303,7 @@
      */
     public void debugAxis(XYPlot plot) {
         logger.debug("...............");
-        for (int i = 0; i < plot.getRangeAxisCount(); i++) {
+        for (int i = 0, P =  plot.getRangeAxisCount(); i < P; i++) {
             if (plot.getRangeAxis(i) == null)
                 logger.debug("Range-Axis #" + i + " == null");
             else {
@@ -1216,7 +1216,7 @@
 
         try {
             JSONArray points = new JSONArray((String) o);
-            for (int i = 0; i < points.length(); i++) {
+            for (int i = 0, P = points.length(); i < P; i++) {
                 JSONArray array = points.getJSONArray(i);
                 double x    = array.getDouble(0);
                 double y    = array.getDouble(1);

http://dive4elements.wald.intevation.org