[PATCH 4 of 4] BedQualityExporter: Use foreach instead of manual array loop

Wald Commits scm-commit at wald.intevation.org
Thu Nov 28 10:46:11 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1385630215 -3600
# Node ID 505737373ba45bec5f29533ce96fa65476a93079
# Parent  61940bae77b5c712614640668e8c285dc5e8e127
BedQualityExporter: Use foreach instead of manual array loop.

diff -r 61940bae77b5 -r 505737373ba4 artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Thu Nov 28 10:14:33 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Thu Nov 28 10:16:55 2013 +0100
@@ -63,8 +63,8 @@
     private List<double[]> createDataRows() {
         TDoubleArrayList kms = new TDoubleArrayList();
         int cols = 1;
-        for (int i = 0; i < results.length; i++) {
-            BedDiameterResult[] beds = results[i].getBedResults();
+        for (BedQualityResult result : results) {
+            BedDiameterResult[] beds = result.getBedResults();
             for (int j = 0; j < beds.length; j++) {
                 TDoubleArrayList bkms = beds[j].getKms();
                 for (int k = 0, K = bkms.size(); k < K; k++) {
@@ -74,7 +74,7 @@
                     }
                 }
             }
-            BedloadDiameterResult[] loads = results[i].getBedloadResults();
+            BedloadDiameterResult[] loads = result.getBedloadResults();
             for (int j = 0; j < loads.length; j++) {
                 TDoubleArrayList lkms = loads[j].getKms();
                 for (int k = 0, L = lkms.size(); k < L; k++) {


More information about the Dive4elements-commits mailing list