summaryrefslogtreecommitdiff
path: root/valexpr.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-08 03:33:56 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-08 03:33:56 -0400
commit842359474e36d8406305b874e82c12594dbc154c (patch)
tree49f186fe2cdbc212430bf18dcde972a8b2c33198 /valexpr.cc
parent612e94ceaa1f063250b706530b9515ce77b32c59 (diff)
downloadfork-ledger-842359474e36d8406305b874e82c12594dbc154c.tar.gz
fork-ledger-842359474e36d8406305b874e82c12594dbc154c.tar.bz2
fork-ledger-842359474e36d8406305b874e82c12594dbc154c.zip
optimize python iterations of entries, transactions; use exceptions more
Diffstat (limited to 'valexpr.cc')
-rw-r--r--valexpr.cc26
1 files changed, 11 insertions, 15 deletions
diff --git a/valexpr.cc b/valexpr.cc
index 7e2a6da0..d868f9b6 100644
--- a/valexpr.cc
+++ b/valexpr.cc
@@ -642,11 +642,10 @@ value_expr_t * parse_logic_expr(std::istream& in)
}
default:
- if (! in.eof()) {
- std::ostringstream err;
- err << "Unexpected character '" << c << "'";
- throw value_expr_error(err.str());
- }
+ if (! in.eof())
+ throw value_expr_error(std::string("Unexpected character '") +
+ c + "'");
+ break;
}
}
}
@@ -687,22 +686,19 @@ value_expr_t * parse_value_expr(std::istream& in)
node->right = choices = new value_expr_t(value_expr_t::O_COL);
choices->left = parse_logic_expr(in);
c = peek_next_nonws(in);
- if (c != ':') {
- std::ostringstream err;
- err << "Unexpected character '" << c << "'";
- throw value_expr_error(err.str());
- }
+ if (c != ':')
+ throw value_expr_error(std::string("Unexpected character '") +
+ c + "'");
in.get(c);
choices->right = parse_logic_expr(in);
break;
}
default:
- if (! in.eof()) {
- std::ostringstream err;
- err << "Unexpected character '" << c << "'";
- throw value_expr_error(err.str());
- }
+ if (! in.eof())
+ throw value_expr_error(std::string("Unexpected character '") +
+ c + "'");
+ break;
}
c = peek_next_nonws(in);
}