From cd9dfa64cb3c8618aab9fd700139ae39f7b4ff84 Mon Sep 17 00:00:00 2001 From: Houtan Bastani <houtan@dynare.org> Date: Tue, 25 Jun 2019 11:12:33 +0200 Subject: [PATCH] macro processor: inline function --- src/macro/Expressions.cc | 6 ------ src/macro/Expressions.hh | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/macro/Expressions.cc b/src/macro/Expressions.cc index 4b1b6fa2..17dd4ad4 100644 --- a/src/macro/Expressions.cc +++ b/src/macro/Expressions.cc @@ -1117,12 +1117,6 @@ TrinaryOp::to_string() const noexcept exit(EXIT_FAILURE); } -string -Comprehension::to_string() const noexcept -{ - return "[" + c_vars->to_string() + " in " + c_set->to_string() + " when " + c_when->to_string() + "]"; -} - void String::print(ostream &output, bool matlab_output) const noexcept { diff --git a/src/macro/Expressions.hh b/src/macro/Expressions.hh index 39082a12..ef1ee74d 100644 --- a/src/macro/Expressions.hh +++ b/src/macro/Expressions.hh @@ -468,7 +468,7 @@ namespace macro Environment &env_arg, const Tokenizer::location location_arg) : Expression(env_arg, move(location_arg)), c_vars{move(c_vars_arg)}, c_set{move(c_set_arg)}, c_when{move(c_when_arg)} { } - string to_string() const noexcept override; + inline string to_string() const noexcept override { return "[" + c_vars->to_string() + " in " + c_set->to_string() + " when " + c_when->to_string() + "]"; } void print(ostream &output, bool matlab_output = false) const noexcept override; BaseTypePtr eval() override; }; -- GitLab