Do not hash rgb values for non rgb colors

This commit is contained in:
Maxime Coste 2015-02-10 22:53:37 +00:00
parent 56dd5f9540
commit 8714c41403

View File

@ -57,7 +57,9 @@ bool is_color_name(StringView color);
inline size_t hash_value(const Color& val)
{
return hash_values(val.color, val.r, val.g, val.b);
return val.color == Colors::RGB ?
hash_values(val.color, val.r, val.g, val.b)
: hash_value(val.color);
}
}