summaryrefslogtreecommitdiff
path: root/src/filters.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-03 17:43:38 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-03 17:43:38 -0400
commit27b86a5388a9b1a5d5c748fa7e6f8aa4a2f1a3f4 (patch)
treed4d4d279d70a03d8e8a0d5b39afeb34c88e87d70 /src/filters.cc
parentc3cc935ba6f22f580518fd8858fbe424f2842f31 (diff)
downloadfork-ledger-27b86a5388a9b1a5d5c748fa7e6f8aa4a2f1a3f4.tar.gz
fork-ledger-27b86a5388a9b1a5d5c748fa7e6f8aa4a2f1a3f4.tar.bz2
fork-ledger-27b86a5388a9b1a5d5c748fa7e6f8aa4a2f1a3f4.zip
Avoid unnecessary object copying when using foreach
Diffstat (limited to 'src/filters.cc')
-rw-r--r--src/filters.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/filters.cc b/src/filters.cc
index ad4b88a0..70a46e8e 100644
--- a/src/filters.cc
+++ b/src/filters.cc
@@ -50,7 +50,7 @@ void post_splitter::print_title(const value_t& val)
void post_splitter::flush()
{
- foreach (value_to_posts_map::value_type pair, posts_map) {
+ foreach (value_to_posts_map::value_type& pair, posts_map) {
preflush_func(pair.first);
foreach (post_t * post, pair.second)
@@ -894,7 +894,7 @@ void posts_as_equity::report_subtotal()
value_t total = 0L;
foreach (values_map::value_type& pair, values) {
if (pair.second.value.is_balance()) {
- foreach (balance_t::amounts_map::value_type amount_pair,
+ foreach (const balance_t::amounts_map::value_type& amount_pair,
pair.second.value.as_balance().amounts)
handle_value(amount_pair.second, pair.second.account, &xact, temps,
handler);
@@ -907,7 +907,7 @@ void posts_as_equity::report_subtotal()
values.clear();
if (total.is_balance()) {
- foreach (balance_t::amounts_map::value_type pair,
+ foreach (const balance_t::amounts_map::value_type& pair,
total.as_balance().amounts) {
post_t& balance_post = temps.create_post(xact, balance_account);
balance_post.amount = - pair.second;