diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-24 04:14:34 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-24 04:14:34 -0500 |
commit | 11a217a481c87cc812a9deb0000d65ecce8e2ba2 (patch) | |
tree | b6a92a6c08a8fa2208b8bf95d97a5d75ba67db0a /src/scope.h | |
parent | 5cd8e5965294babfce4ed3eed7d8461c1649fe5a (diff) | |
download | fork-ledger-11a217a481c87cc812a9deb0000d65ecce8e2ba2.tar.gz fork-ledger-11a217a481c87cc812a9deb0000d65ecce8e2ba2.tar.bz2 fork-ledger-11a217a481c87cc812a9deb0000d65ecce8e2ba2.zip |
Very minor but easy optimization for symbol_scope_t
Lots of symbol_scope_t throwaway objects get created during value
expression calculation, and 99% of them are never used. Therefore, the
std::map which each contains is now within an optional<> wrapper, so
that no constructor happens unless one is actually used.
Diffstat (limited to 'src/scope.h')
-rw-r--r-- | src/scope.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/scope.h b/src/scope.h index 44ca3229..93f80230 100644 --- a/src/scope.h +++ b/src/scope.h @@ -172,7 +172,7 @@ class symbol_scope_t : public child_scope_t { typedef std::map<symbol_t, expr_t::ptr_op_t> symbol_map; - symbol_map symbols; + optional<symbol_map> symbols; public: explicit symbol_scope_t() { |