changeset 5198:0e91d200299d new-fwa

Removed duplicated code.
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 08 May 2020 09:24:19 +0200
parents c352dbbf2778
children 5001582f2ee1
files pkg/controllers/bottlenecks.go
diffstat 1 files changed, 1 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/pkg/controllers/bottlenecks.go	Thu May 07 17:50:29 2020 +0200
+++ b/pkg/controllers/bottlenecks.go	Fri May 08 09:24:19 2020 +0200
@@ -345,18 +345,7 @@
 		}
 	}
 
-	sort.Float64s(values)
-
-	// dedup
-	for i := 1; i < len(values); {
-		if values[i-1] == values[i] {
-			copy(values[i:], values[i+1:])
-			values = values[:len(values)-1]
-		} else {
-			i++
-		}
-	}
-	return values
+	return common.DedupFloat64s(values)
 }
 
 func bottleneckAvailabilty(rw http.ResponseWriter, req *http.Request) {