summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-05 02:23:49 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-05 02:27:39 -0500
commit3dc200983d5057a7760aeb9e864479c902d7e1d7 (patch)
tree6f754a113f97af3dd856cd7e507f91da9e9e0402 /src/account.cc
parent40a430139edd12d9f580f5616571bc3ed8709d73 (diff)
downloadfork-ledger-3dc200983d5057a7760aeb9e864479c902d7e1d7.tar.gz
fork-ledger-3dc200983d5057a7760aeb9e864479c902d7e1d7.tar.bz2
fork-ledger-3dc200983d5057a7760aeb9e864479c902d7e1d7.zip
Moved xdata clearing code into each type proper
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/account.cc b/src/account.cc
index 2a75a6ac..43b7cd56 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -382,6 +382,15 @@ account_t::xdata_t::details_t::operator+=(const details_t& other)
return *this;
}
+void account_t::clear_xdata()
+{
+ xdata_ = none;
+
+ foreach (accounts_map::value_type& pair, accounts)
+ if (! pair.second->has_flags(ACCOUNT_TEMP))
+ pair.second->clear_xdata();
+}
+
value_t account_t::amount(const optional<expr_t&>& expr) const
{
if (xdata_ && xdata_->has_flags(ACCOUNT_EXT_VISITED)) {