]> git.lyx.org Git - lyx.git/blobdiff - src/Session.cpp
Amend 3093789e for cmake build
[lyx.git] / src / Session.cpp
index 3bb9c03a330005d0702de9f0d4f00246e4b971ae..c80bca5222ff4e8d91b51e901cdd81bb4ef9f8a0 100644 (file)
@@ -144,8 +144,8 @@ void LastOpenedSection::read(istream & is)
 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';
 }
 
 
@@ -158,8 +158,8 @@ void LastOpenedSection::add(FileName const & file, bool active)
        // 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);
@@ -383,9 +383,9 @@ void LastCommandsSection::setNumberOfLastCommands(unsigned int no)
 }
 
 
-void LastCommandsSection::add(std::string const & string)
+void LastCommandsSection::add(std::string const & command)
 {
-       lastcommands.push_back(string);
+       lastcommands.push_back(command);
 }
 
 
@@ -494,10 +494,7 @@ void AuthFilesSection::write(ostream & os) const
 
 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();
 }
 
 
@@ -547,10 +544,7 @@ bool ShellEscapeSection::find(string const & name) const
 
 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();
 }