[PATCH 1 of 2] Minor code simplification

Wald Commits scm-commit at wald.intevation.org
Tue Oct 8 09:16:17 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1381215645 -7200
# Node ID 88b70c788b0f4614da6cd1f778fc574fff4d3649
# Parent  b8d6aac3acf2809590c7ed7f1468814a66a11844
Minor code simplification.

diff -r b8d6aac3acf2 -r 88b70c788b0f artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Mon Oct 07 11:13:40 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Oct 08 09:00:45 2013 +0200
@@ -401,8 +401,6 @@
 
             double gaugeDatum = getCurrentGaugeDatum();
 
-            double factor = (gaugeDatum == 0d) ? 1d : 100d;
-
             if (gaugeDatum == 0d) {
                 addAxisSeries(series, YAXIS.W.idx, visible);
             }
@@ -417,7 +415,7 @@
                 addAxisSeries(series2, YAXIS.W.idx, false);
                 // Use second axis at cm if at gauge.
                 for (int i = 0; i < series.getItemCount(); i++) {
-                    series.updateByIndex(i, new Double(factor*(series.getY(i).doubleValue()-gaugeDatum)));
+                    series.updateByIndex(i, new Double(100d*(series.getY(i).doubleValue()-gaugeDatum)));
                 }
                 addAxisSeries(series, YAXIS.WCm.idx, visible);
             }


More information about the Dive4elements-commits mailing list