diff options
author | deva <deva> | 2009-07-30 16:52:54 +0000 |
---|---|---|
committer | deva <deva> | 2009-07-30 16:52:54 +0000 |
commit | 2ab16123cc7566b597da05a9a0cb98c33eceff35 (patch) | |
tree | 2337e58870ce05a5e16973efc99416bbe4576f50 /server/src/journal_commit.cc | |
parent | 1569827e40b9a622c818b806b3a19ab12ff04eb4 (diff) |
Some cleaning up. Much more work to do in that area though, including writing of a new unit test program.
Diffstat (limited to 'server/src/journal_commit.cc')
-rw-r--r-- | server/src/journal_commit.cc | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/server/src/journal_commit.cc b/server/src/journal_commit.cc index 21d40c3..f2ff6c0 100644 --- a/server/src/journal_commit.cc +++ b/server/src/journal_commit.cc @@ -52,6 +52,12 @@ #include "template.h" #include "templateparser.h" +class ResumeEntry { +public: + std::string resume; + std::string macro; +}; + static inline bool iswhitespace(char c) { return c == ' ' || c == '\n' || c == '\t'; @@ -224,7 +230,7 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit, if(index >= templ->macros.size()) { PRACRO_ERR(journal, "Could not find macro %s in template %s\n", - commit.macro.c_str(), templname.c_str()); + commit.macro.c_str(), templname.c_str()); // return; } else { PRACRO_DEBUG(journal, "Found macro %s as index %u in template %s\n", @@ -261,28 +267,6 @@ void JournalWriter::addEntry(Transaction &transaction, Commit &commit, std::string r = stripTrailingWhitepace(addNewlines(resume, 60)); std::string m = commit.macro; - /* - // If macro already exists, overwrite with this entry, otherwise, just add it - int idx = -1; - std::vector< ResumeEntry >::iterator i = entrylist.begin(); - int cnt = 0; - while(i != entrylist.end()) { - if(i->macro == m) idx = cnt; - cnt++; - i++; - } - - if(idx != -1) { - entrylist[idx].resume = r; - entrylist[idx].macro = m; - } else { - ResumeEntry re; - re.resume = r; - re.macro = m; - entrylist.push_back(re); - } - */ - ResumeEntry re; re.resume = r; re.macro = m; |