diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java @ 1796:ae6ace900c07

Small loop optimization flys-artifacts/trunk@3119 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 31 Oct 2011 10:01:08 +0000
parents 2e5ebdeb8af9
children eef657302834
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java	Sun Oct 30 19:28:59 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java	Mon Oct 31 10:01:08 2011 +0000
@@ -103,7 +103,10 @@
      * @return according WKms.
      */
     public static WKms getWKmsUncached(int column, int wst_id) {
-        log.debug("WKmsFactory.getWKmsUncached c/" + column + ", wst_id/" + wst_id);
+
+        if (log.isDebugEnabled()) {
+            log.debug("WKmsFactory.getWKmsUncached c/" + column + ", wst_id/" + wst_id);
+        }
 
         WKmsImpl wkms = new WKmsImpl(getWKmsName(column, wst_id));
 
@@ -121,7 +124,7 @@
 
         int lastColumn = Integer.MAX_VALUE;
 
-        for (int i = 0; i < results.size(); i++) {
+        for (int i = 0, N = results.size(); i < N; i++) {
             Object[] row = results.get(i);
             wkms.add((Double) row[0], (Double) row[1]);
         }

http://dive4elements.wald.intevation.org