diff --git a/daemon/src/history/history.cpp b/daemon/src/history/history.cpp index 4b0d4e47ba098c3113d4d39afff04d540f2f4fb1..dab738de469a78d0ee3a0e07826be321c1955b87 100644 --- a/daemon/src/history/history.cpp +++ b/daemon/src/history/history.cpp @@ -86,9 +86,8 @@ bool History::save() std::ofstream outfile(path_.c_str()); if (outfile.fail()) return false; - for (vector<HistoryItem>::const_iterator iter = items_.begin(); - iter != items_.end(); ++iter) - outfile << *iter << std::endl; + for (const auto &iter : items_) + outfile << iter << std::endl; return true; } @@ -129,9 +128,8 @@ vector<map<string, string> > History::getSerialized() { sfl::ScopedLock lock(historyItemsMutex_); vector<map<string, string> > result; - for (vector<HistoryItem>::const_iterator iter = items_.begin(); - iter != items_.end(); ++iter) - result.push_back(iter->toMap()); + for (const auto &iter : items_) + result.push_back(iter.toMap()); return result; }