From 44b6c39c9013c5a688b429798f9c1ec329c98fce Mon Sep 17 00:00:00 2001 From: Angelos Mantzaflaris Date: Thu, 7 Dec 2017 23:48:28 +0100 Subject: [PATCH] shorten if statement and add brackets --- exprtk.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/exprtk.hpp b/exprtk.hpp index 56ce801..fcfdd2e 100644 --- a/exprtk.hpp +++ b/exprtk.hpp @@ -1,5 +1,5 @@ /* - ****************************************************************** +g ****************************************************************** * C++ Mathematical Expression Toolkit Library * * * * Author: Arash Partow (1999-2017) * @@ -17057,12 +17057,8 @@ namespace exprtk #define exprtk_define_freefunction(NN) \ inline bool add_function(const std::string& function_name, ff##NN##_functor function) \ { \ - if (!valid()) \ - return false; \ - else if (!valid_symbol(function_name)) \ - return false; \ - else if (symbol_exists(function_name)) \ - return false; \ + if (!valid() || !valid_symbol(function_name) || symbol_exists(function_name)) \ + {return false;} \ \ exprtk::ifunction* ifunc = new freefunc##NN(function); \ \