mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
* #28351: history: use range-based for loops
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user