summaryrefslogtreecommitdiff
path: root/src/gui/palette.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-12-05 21:45:05 +0300
committerAndrei Karas <akaras@inbox.ru>2011-12-05 21:47:10 +0300
commit2d452dd8faf2529fda01913b0ab26f4a1f22ef3d (patch)
tree818e1d9aa3088deca6cdcd5df72858b3dec56a0c /src/gui/palette.cpp
parent940161d95ee7c9e9ef4c6941d3d464d4264a94ad (diff)
downloadmanaplus-2d452dd8faf2529fda01913b0ab26f4a1f22ef3d.tar.gz
manaplus-2d452dd8faf2529fda01913b0ab26f4a1f22ef3d.tar.bz2
manaplus-2d452dd8faf2529fda01913b0ab26f4a1f22ef3d.tar.xz
manaplus-2d452dd8faf2529fda01913b0ab26f4a1f22ef3d.zip
A bit improve speed in getting color from theme.
Diffstat (limited to 'src/gui/palette.cpp')
-rw-r--r--src/gui/palette.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp
index f3046264f..348f97de8 100644
--- a/src/gui/palette.cpp
+++ b/src/gui/palette.cpp
@@ -65,15 +65,13 @@ Palette::~Palette()
const gcn::Color& Palette::getColor(char c, bool &valid)
{
- for (Colors::const_iterator col = mColors.begin(),
- colEnd = mColors.end(); col != colEnd; ++col)
+ CharColors::const_iterator it = mCharColors.find(c);
+ if (it != mCharColors.end())
{
- if (col->ch == c)
- {
- valid = true;
- return col->color;
- }
+ valid = true;
+ return mColors[(*it).second].color;
}
+
valid = false;
return BLACK;
}