summaryrefslogtreecommitdiff
path: root/src/annotate.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-03 01:26:30 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-03 01:26:30 -0400
commit30479c0e1283201f905e2129970ad4784c9c5ba2 (patch)
tree38fadc893e4f7b601f068169a1fefc3e37fdbf72 /src/annotate.cc
parent4a0236e964f5b39f38c3a8cd560bcfe6e4878912 (diff)
downloadfork-ledger-30479c0e1283201f905e2129970ad4784c9c5ba2.tar.gz
fork-ledger-30479c0e1283201f905e2129970ad4784c9c5ba2.tar.bz2
fork-ledger-30479c0e1283201f905e2129970ad4784c9c5ba2.zip
A simple, yet significiant, optimization
Every annotated commodity is based on a "referent", or the unannotated version of that commodity. When stripping all annotations away, however, rather than simply returning the referent we were actually searching for it by name. There was no reason to do this, not to mention it was taking up to 7% of the total runtime of some reports.
Diffstat (limited to 'src/annotate.cc')
-rw-r--r--src/annotate.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/annotate.cc b/src/annotate.cc
index 99c12fc3..feb3b3ca 100644
--- a/src/annotate.cc
+++ b/src/annotate.cc
@@ -190,7 +190,7 @@ annotated_commodity_t::strip_annotations(const keep_details_t& what_to_keep)
keep_date ? details.date : none,
keep_tag ? details.tag : none));
} else {
- new_comm = pool().find_or_create(base_symbol());
+ new_comm = &referent();
}
assert(new_comm);