summaryrefslogtreecommitdiff
path: root/src/account.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
commitbfd9ecf2af079894f95bac365818c9548f561039 (patch)
treedce7e13ec7ad8f18bc628efe511d17e94bc3e16d /src/account.cc
parenta034435c4287aba7fd32ed63a745e560350c924a (diff)
parent49a356f2d260ed0cc071ca1aa82027bd325b0b8b (diff)
downloadfork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.gz
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.bz2
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.zip
Merge branch 'next'
Diffstat (limited to 'src/account.cc')
-rw-r--r--src/account.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/account.cc b/src/account.cc
index 5cc7e070..da43745a 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -327,16 +327,25 @@ bool account_t::valid() const
return true;
}
+bool account_t::children_with_xdata() const
+{
+ foreach (const accounts_map::value_type& pair, accounts)
+ if (pair.second->has_xdata() ||
+ pair.second->children_with_xdata())
+ return true;
+
+ return false;
+}
+
std::size_t account_t::children_with_flags(xdata_t::flags_t flags) const
{
std::size_t count = 0;
bool grandchildren_visited = false;
- foreach (const accounts_map::value_type& pair, accounts) {
+ foreach (const accounts_map::value_type& pair, accounts)
if (pair.second->has_xflags(flags) ||
pair.second->children_with_flags(flags))
count++;
- }
// Although no immediately children were visited, if any progeny at all were
// visited, it counts as one.