From dd51f5a487ed32fe02a5120f7147a5880699899b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 8 Dec 2001 03:27:31 +0000 Subject: [PATCH] (getGCLinepars): only lookup in the linecache once. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3169 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 1 + src/ColorHandler.C | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) 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);