[PATCH 2 of 4] BedQualityExporter: Continue/exit early when no results

Wald Commits scm-commit at wald.intevation.org
Mon Dec 2 12:16:54 CET 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1385977650 -3600
# Node ID 182f78d5f3ebae8f2be51e8784aa82194677bdc2
# Parent  e999a920f0e5120e7b666bc88ca7da43eba935f8
BedQualityExporter: Continue/exit early when no results.

diff -r e999a920f0e5 -r 182f78d5f3eb artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Mon Dec 02 10:42:43 2013 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityExporter.java	Mon Dec 02 10:47:30 2013 +0100
@@ -119,6 +119,9 @@
                         loads[k].getDiameter(km);
                 }
                 BedDiameterResult[] beds = results[j].getBedResults();
+                if (beds.length == 0) {
+                    continue;
+                }
                 for (int k = 0; k < beds.length; k++) {
                     // k + 1: shift km column.
                     // j * beds.length: shift periods.
@@ -127,9 +130,6 @@
                     row[ndx] = beds[k].getDiameterCap(km);
                     row[ndx + 1] = beds[k].getDiameterSub(km);
                 }
-                if (beds.length == 0) {
-                    continue;
-                }
                 BedParametersResult[] params = results[j].getParameters();
                 for(int k = 0; k < params.length; k++) {
                     // loads.length + (beds.lenght * 2) * (j + 1): shift bed and bedload columns.


More information about the Dive4elements-commits mailing list