expression parser - avoid extra level of indirection

This commit is contained in:
Dane Springmeyer 2013-11-13 18:44:58 -08:00
parent dc3fad51a3
commit 2564c00420

View file

@ -44,13 +44,13 @@ expression_ptr parse_expression(std::string const& str, std::string const& encod
expression_ptr parse_expression(std::string const& str, expression_ptr parse_expression(std::string const& str,
mapnik::expression_grammar<std::string::const_iterator> const& g) mapnik::expression_grammar<std::string::const_iterator> const& g)
{ {
expr_node node; expression_ptr node = boost::make_shared<expr_node>();
std::string::const_iterator itr = str.begin(); std::string::const_iterator itr = str.begin();
std::string::const_iterator end = str.end(); std::string::const_iterator end = str.end();
bool r = boost::spirit::qi::phrase_parse(itr, end, g, boost::spirit::standard_wide::space, node); bool r = boost::spirit::qi::phrase_parse(itr, end, g, boost::spirit::standard_wide::space, *node);
if (r && itr == end) if (r && itr == end)
{ {
return boost::make_shared<expr_node>(node); return node;
} }
else else
{ {