Commit 17bf6cea authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #28351: history: use range-based for loops

parent 61e6269b
......@@ -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;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment