72 auto hashEntry =
d->colorHash.find(
color);
73 if (hashEntry !=
d->colorHash.end()) {
74 auto historyEl = std::lower_bound(
d->history.begin(),
d->history.end(), *hashEntry, &
ColorEntry::less);
75 if (historyEl !=
d->history.end()) {
76 int oldPos = historyEl -
d->history.begin();
77 if (historyEl ==
d->history.begin()) {
82 d->history.erase(historyEl);
84 d->history.push_front(node);
88 qDebug() <<
"inconsistent color history state!";
93 if (
d->history.size() >=
d->maxSize) {
94 entry =
d->history.back();
95 d->history.pop_back();
98 entry->
key = ++
d->key;
104 d->colorHash.insert(
color, entry);
105 d->history.push_front(entry);
static bool less(const KisUniqueColorSet::ColorEntry *lhs, const KisUniqueColorSet::ColorEntry *rhs)