diff options
author | John Wiegley <johnw@newartisans.com> | 2017-12-30 11:27:12 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-30 11:27:12 -0800 |
commit | dc4cb5e623dff270b9298f9e99f352090719435b (patch) | |
tree | 120735640c78bd7de1785bc9f09a2f368c5abc10 /src/session.h | |
parent | 77ae14230b0ce38cc2c7fee401d7b6aeb2610191 (diff) | |
parent | 9409f25d0de638097a806f1f75b75473be192b82 (diff) | |
download | fork-ledger-dc4cb5e623dff270b9298f9e99f352090719435b.tar.gz fork-ledger-dc4cb5e623dff270b9298f9e99f352090719435b.tar.bz2 fork-ledger-dc4cb5e623dff270b9298f9e99f352090719435b.zip |
Merge pull request #503 from ghost91-/next
Use an std::set instead of an std::list to store the the journal file paths
Diffstat (limited to 'src/session.h')
-rw-r--r-- | src/session.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/session.h b/src/session.h index bb9c5f7e..7e299959 100644 --- a/src/session.h +++ b/src/session.h @@ -52,6 +52,16 @@ namespace ledger { class xact_t; +struct ComparePaths +{ + bool operator()(const path& p1, const path& p2) const + { + return p1 < p2 && !boost::filesystem::equivalent(p1, p2); + } +}; + +#define COMMA , + class session_t : public symbol_scope_t { friend void set_session_context(session_t * session); @@ -143,14 +153,14 @@ public: OPTION__ (session_t, file_, // -f - std::list<path> data_files; + std::set<path COMMA ComparePaths> data_files; CTOR(session_t, file_) {} DO_(str) { if (parent->flush_on_next_data_file) { data_files.clear(); parent->flush_on_next_data_file = false; } - data_files.push_back(str); + data_files.insert(str); }); OPTION_(session_t, input_date_format_, DO_(str) { |