diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-12 14:29:08 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-12 14:29:08 -0500 |
commit | bfd9ecf2af079894f95bac365818c9548f561039 (patch) | |
tree | dce7e13ec7ad8f18bc628efe511d17e94bc3e16d /src/account.cc | |
parent | a034435c4287aba7fd32ed63a745e560350c924a (diff) | |
parent | 49a356f2d260ed0cc071ca1aa82027bd325b0b8b (diff) | |
download | fork-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.cc | 13 |
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. |