void LastOpenedSection::write(ostream & os) const
{
os << '\n' << sec_lastopened << '\n';
- for (size_t i = 0; i < lastopened.size(); ++i)
- os << lastopened[i].active << ", " << lastopened[i].file_name << '\n';
+ for (auto const & last : lastopened)
+ os << last.active << ", " << last.file_name << '\n';
}
// currently, we even crash in some cases (see #9483).
// FIXME: Add session support for multiple views of
// the same buffer (split-view etc.).
- for (size_t i = 0; i < lastopened.size(); ++i) {
- if (lastopened[i].file_name == file)
+ for (auto const & last : lastopened) {
+ if (last.file_name == file)
return;
}
lastopened.push_back(lof);
}
-void LastCommandsSection::add(std::string const & string)
+void LastCommandsSection::add(std::string const & command)
{
- lastcommands.push_back(string);
+ lastcommands.push_back(command);
}
bool AuthFilesSection::find(string const & name) const
{
- if (auth_files_.find(name) != auth_files_.end())
- return true;
-
- return false;
+ return auth_files_.find(name) != auth_files_.end();
}
bool ShellEscapeSection::findAuth(string const & name) const
{
- if (shellescape_files_.find(name + ",1") != shellescape_files_.end())
- return true;
-
- return false;
+ return shellescape_files_.find(name + ",1") != shellescape_files_.end();
}