From 3be068f8daf540d13f1348f992066de95545e39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20Ka=CC=88fer?= Date: Tue, 20 May 2014 11:23:33 +0200 Subject: [PATCH] make sure they never throw. asserts are compiled out in production! --- src/style/properties.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/style/properties.cpp b/src/style/properties.cpp index 6563d5431..74a5b288c 100644 --- a/src/style/properties.cpp +++ b/src/style/properties.cpp @@ -13,18 +13,15 @@ float functions::null(float, const std::vector&) { } float functions::constant(float, const std::vector& values) { - assert(values.size() == 1); - return values.front(); + return values.size() >= 1 ? values.front() : 0.0f; } float functions::min(float z, const std::vector& values) { - assert(values.size() == 1); - return z >= values.front(); + return values.size() >= 1 && z >= values.front(); } float functions::max(float z, const std::vector& values) { - assert(values.size() == 1); - return z <= values.front(); + return values.size() >= 1 && z <= values.front(); } float functions::stops(float z, const std::vector& stops) {