]> git.lyx.org Git - features.git/commitdiff
Use std::map::find() instead of iterating ourselves.
authorRichard Heck <rgheck@lyx.org>
Sat, 9 Feb 2013 19:37:42 +0000 (14:37 -0500)
committerRichard Heck <rgheck@lyx.org>
Sat, 9 Feb 2013 19:40:22 +0000 (14:40 -0500)
src/TextClass.cpp

index 742eae3e0604d905eb16346deb7db0db16553ddd..3609deec2cf393bbffdbcfff5aab2f288b498c60 100644 (file)
@@ -1252,12 +1252,8 @@ bool TextClass::hasInsetLayout(docstring const & n) const
 {
        if (n.empty())
                return false;
-       InsetLayouts::const_iterator it = insetlayoutlist_.begin();
-       InsetLayouts::const_iterator en = insetlayoutlist_.end();
-       for (; it != en; ++it)
-               if (n == it->first)
-                       return true;
-       return false;
+       InsetLayouts::const_iterator it = insetlayoutlist_.find(n);
+       return it != insetlayoutlist_.end();
 }