shorten if statement and add brackets

This commit is contained in:
Angelos Mantzaflaris 2017-12-07 23:48:28 +01:00
parent cf1e3f25a1
commit 44b6c39c90
1 changed files with 3 additions and 7 deletions

View File

@ -1,5 +1,5 @@
/* /*
****************************************************************** g ******************************************************************
* C++ Mathematical Expression Toolkit Library * * C++ Mathematical Expression Toolkit Library *
* * * *
* Author: Arash Partow (1999-2017) * * Author: Arash Partow (1999-2017) *
@ -17057,12 +17057,8 @@ namespace exprtk
#define exprtk_define_freefunction(NN) \ #define exprtk_define_freefunction(NN) \
inline bool add_function(const std::string& function_name, ff##NN##_functor function) \ inline bool add_function(const std::string& function_name, ff##NN##_functor function) \
{ \ { \
if (!valid()) \ if (!valid() || !valid_symbol(function_name) || symbol_exists(function_name)) \
return false; \ {return false;} \
else if (!valid_symbol(function_name)) \
return false; \
else if (symbol_exists(function_name)) \
return false; \
\ \
exprtk::ifunction<T>* ifunc = new freefunc##NN(function); \ exprtk::ifunction<T>* ifunc = new freefunc##NN(function); \
\ \