[PATCH 2 of 2] Improve coding style in KMFilter loops

Wald Commits scm-commit at wald.intevation.org
Tue Mar 31 17:28:34 CEST 2015


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1427815707 -7200
# Node ID 81a8e304379438e6e5ee8c1a89ce822306b1986a
# Parent  dcdccd59c3bec3da3f2b69e78cd81ccf1357279d
Improve coding style in KMFilter loops

diff -r dcdccd59c3be -r 81a8e3043794 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java	Tue Mar 31 17:27:20 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WKmsImpl.java	Tue Mar 31 17:28:27 2015 +0200
@@ -112,8 +112,8 @@
     @Override
     public WKms filteredKms(double from, double to) {
         WKmsImpl retval = new WKmsImpl(getName());
-        for (int i = 0; i < size(); i++) {
-            double km = kms.getQuick(i);
+        for (int i = 0, S = size(); i < S; i++) {
+            double km = getKm(i);
             if (km >= from && km <= to) {
                 retval.add(km, getW(i));
             }
diff -r dcdccd59c3be -r 81a8e3043794 artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Tue Mar 31 17:27:20 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKms.java	Tue Mar 31 17:28:27 2015 +0200
@@ -140,10 +140,10 @@
     @Override
     public WKms filteredKms(double from, double to) {
         WQKms retval = new WQKms(getName());
-        for (int i = 0; i < size(); i++) {
-            double km = kms.getQuick(i);
+        for (int i = 0, S = size(); i < S; i++) {
+            double km = getKm(i);
             if (km >= from && km <= to) {
-                retval.add(ws.getQuick(i), qs.getQuick(i), km);
+                retval.add(getW(i), getQ(i), km);
             }
         }
         return retval;


More information about the Dive4Elements-commits mailing list