modified entry_t::add_transaction and remove_transaction, since now using lists
This commit is contained in:
parent
93d73f828c
commit
e2990dbc4e
1 changed files with 3 additions and 21 deletions
22
journal.cc
22
journal.cc
|
|
@ -60,27 +60,9 @@ void entry_t::add_transaction(transaction_t * xact)
|
||||||
|
|
||||||
bool entry_t::remove_transaction(transaction_t * xact)
|
bool entry_t::remove_transaction(transaction_t * xact)
|
||||||
{
|
{
|
||||||
bool found = false;
|
transactions.remove(xact);
|
||||||
transactions_list::iterator i;
|
xact->account->transactions.remove(xact);
|
||||||
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 true;
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool entry_t::valid() const
|
bool entry_t::valid() const
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue