From: Lars Gullik Bjønnes Date: Sat, 8 Dec 2001 03:27:31 +0000 (+0000) Subject: (getGCLinepars): only lookup in the linecache once. X-Git-Tag: 1.6.10~20209 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=dd51f5a487ed32fe02a5120f7147a5880699899b;p=features.git (getGCLinepars): only lookup in the linecache once. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3169 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/ChangeLog b/src/ChangeLog index 7fe0d6df1e..ad2cae8f70 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -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 diff --git a/src/ColorHandler.C b/src/ColorHandler.C index c6f6fba32a..3bb56cbc53 100644 --- a/src/ColorHandler.C +++ b/src/ColorHandler.C @@ -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);