]> git.lyx.org Git - features.git/commitdiff
(getGCLinepars): only lookup in the linecache once.
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Dec 2001 03:27:31 +0000 (03:27 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 8 Dec 2001 03:27:31 +0000 (03:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3169 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/ColorHandler.C

index 7fe0d6df1ef8deaef8d6e038e33662b9bc756f6a..ad2cae8f7028fb73b8630434a09f412047ef94ab 100644 (file)
@@ -3,6 +3,7 @@
        * ColorHandler.C (updateColor): change the hash to cover the whole
        LColor enum, ws cleanup
        (getGCLinepars): ditto
+       (getGCLinepars): only lookup in the linecache once.
 
 2001-12-07  Dekel Tsur  <dekelts@tau.ac.il>
 
index c6f6fba32a0f27ad19672a88b658f19961c745a1..3bb56cbc531b4ec23e43fefb682db5b5fe35c3ae 100644 (file)
@@ -172,8 +172,9 @@ GC LyXColorHandler::getGCLinepars(PainterBase::line_style ls,
        
        int index = lw + (ls << 1) + (c << 6);
 
-       if (lineGCcache.find(index) != lineGCcache.end())
-               return lineGCcache[index];
+       LineGCCache::iterator it = lineGCcache.find(index);
+       if (it != lineGCcache.end())
+               return it->second;
 
        XGCValues val;
        XGetGCValues(display, getGCForeground(c), GCForeground, &val);