diff options
author | John Wiegley <johnw@newartisans.com> | 2007-04-20 02:13:48 +0000 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2008-04-13 03:38:28 -0400 |
commit | 539370ff1b37772e9f11439f652ffd3583beeedb (patch) | |
tree | 69e8b0a0aee571d7335eae4c6693829745de1484 /balance.cc | |
parent | 0a6b5726ec3bf402a953ea8a03b98ecbf4b90b0c (diff) | |
download | ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.gz ledger-539370ff1b37772e9f11439f652ffd3583beeedb.tar.bz2 ledger-539370ff1b37772e9f11439f652ffd3583beeedb.zip |
More refactoring
Diffstat (limited to 'balance.cc')
-rw-r--r-- | balance.cc | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -33,7 +33,7 @@ amount_t balance_t::amount(const commodity_t& commodity) const return amount_t(); } -balance_t balance_t::value(const ptime& moment) const +balance_t balance_t::value(const moment_t& moment) const { balance_t temp; @@ -57,18 +57,18 @@ balance_t balance_t::price() const return temp; } -ptime balance_t::date() const +moment_t balance_t::date() const { - ptime temp; + moment_t temp; for (amounts_map::const_iterator i = amounts.begin(); i != amounts.end(); i++) { - ptime tdate = (*i).second.date(); - if (temp.is_not_a_date_time() && ! tdate.is_not_a_date_time()) + moment_t tdate = (*i).second.date(); + if (! is_valid_moment(temp) && is_valid_moment(tdate)) temp = tdate; else if (temp != tdate) - return ptime(); + return moment_t(); } return temp; } |