summaryrefslogtreecommitdiff
path: root/balance.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2007-04-20 23:49:18 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 03:38:29 -0400
commitc30f52090012f4632f4cfe6536abc4af7edfe363 (patch)
tree07388964ba67caba450283b28c7a9eff7e01a220 /balance.cc
parentb84f676946941df6f7e8476d77d1db0cbe7736c5 (diff)
downloadfork-ledger-c30f52090012f4632f4cfe6536abc4af7edfe363.tar.gz
fork-ledger-c30f52090012f4632f4cfe6536abc4af7edfe363.tar.bz2
fork-ledger-c30f52090012f4632f4cfe6536abc4af7edfe363.zip
Decreased memory usage considerably
Diffstat (limited to 'balance.cc')
-rw-r--r--balance.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/balance.cc b/balance.cc
index be2d348c..f36049c9 100644
--- a/balance.cc
+++ b/balance.cc
@@ -1,7 +1,7 @@
#include "balance.h"
#include "util.h"
-#include <deque>
+#include <vector>
#include <algorithm>
namespace ledger {
@@ -115,8 +115,8 @@ void balance_t::write(std::ostream& out,
out << std::right << (*i).second;
}
} else {
- typedef std::deque<const amount_t *> amounts_deque;
- amounts_deque sorted;
+ typedef std::vector<const amount_t *> amounts_array;
+ amounts_array sorted;
for (amounts_map::const_iterator i = amounts.begin();
i != amounts.end();
@@ -127,7 +127,7 @@ void balance_t::write(std::ostream& out,
std::stable_sort(sorted.begin(), sorted.end(),
compare_amount_commodities());
- for (amounts_deque::const_iterator i = sorted.begin();
+ for (amounts_array::const_iterator i = sorted.begin();
i != sorted.end();
i++) {
int width;