]> git.lyx.org Git - features.git/commitdiff
A few more small optimizations noted along the way.
authorRichard Heck <rgheck@lyx.org>
Mon, 28 May 2012 22:21:22 +0000 (18:21 -0400)
committerRichard Heck <rgheck@lyx.org>
Mon, 28 May 2012 22:21:22 +0000 (18:21 -0400)
src/tex2lyx/text.cpp

index 24694d3da27dce83260f1c0440240288b303975b..46d4d678b4d77cfcebef8ea357e2a323cd02a744 100644 (file)
@@ -461,7 +461,9 @@ docstring convert_unicodesymbols(docstring s)
                set<string> req;
                docstring parsed = encodings.fromLaTeXCommand(s,
                                Encodings::TEXT_CMD, termination, rem, &req);
-               for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
+               set<string>::const_iterator it = req.begin();
+               set<string>::const_iterator en = req.end();
+               for (; it != en; ++it)
                        preamble.registerAutomaticallyLoadedPackage(*it);
                os << parsed;
                s = rem;
@@ -1556,7 +1558,9 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                if (!preamble.titleLayoutFound())
                        preamble.titleLayoutFound(newlayout->intitle);
                set<string> const & req = newlayout->requires();
-               for (set<string>::const_iterator it = req.begin(); it != req.end(); ++it)
+               set<string>::const_iterator it = req.begin();
+               set<string>::const_iterator en = req.end();
+               for (; it != en; ++it)
                        preamble.registerAutomaticallyLoadedPackage(*it);
        }
 
@@ -2486,8 +2490,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer,
                                        if (!preamble.titleLayoutFound())
                                                preamble.titleLayoutFound(newlayout->intitle);
                                        set<string> const & req = newlayout->requires();
-                                       for (set<string>::const_iterator it = req.begin();
-                                            it != req.end(); ++it)
+                                       set<string>::const_iterator it = req.begin();
+                                       set<string>::const_iterator en = req.end();
+                                       for (; it != en; ++it)
                                                preamble.registerAutomaticallyLoadedPackage(*it);
                                } else
                                        handle_ert(os,