expression parser - avoid extra level of indirection
This commit is contained in:
parent
dc3fad51a3
commit
2564c00420
1 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue