summaryrefslogtreecommitdiff
path: root/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2004-09-06 18:16:24 -0400
committerJohn Wiegley <johnw@newartisans.com>2004-09-06 18:16:24 -0400
commite2990dbc4edc883d527b24dff2759d1850030601 (patch)
treead9d8524ca4b77365845faafce7b8a010217999f /journal.cc
parent93d73f828ce0425cb806b669a8075bd4b9e74340 (diff)
downloadfork-ledger-e2990dbc4edc883d527b24dff2759d1850030601.tar.gz
fork-ledger-e2990dbc4edc883d527b24dff2759d1850030601.tar.bz2
fork-ledger-e2990dbc4edc883d527b24dff2759d1850030601.zip
modified entry_t::add_transaction and remove_transaction, since now using lists
Diffstat (limited to 'journal.cc')
-rw-r--r--journal.cc24
1 files changed, 3 insertions, 21 deletions
diff --git a/journal.cc b/journal.cc
index a4bf4401..e4c53dd0 100644
--- a/journal.cc
+++ b/journal.cc
@@ -60,27 +60,9 @@ void entry_t::add_transaction(transaction_t * xact)
bool entry_t::remove_transaction(transaction_t * xact)
{
- bool found = false;
- transactions_list::iterator i;
- for (i = transactions.begin(); i != transactions.end(); i++)
- if (*i == xact) {
- found = true;
- break;
- }
- if (! found)
- return false;
-
- transactions.erase(i);
-
- for (i = xact->account->transactions.begin();
- i != xact->account->transactions.end();
- i++)
- if (*i == xact) {
- xact->account->transactions.erase(i);
- return true;
- }
-
- return false;
+ transactions.remove(xact);
+ xact->account->transactions.remove(xact);
+ return true;
}
bool entry_t::valid() const