54 auto hashEntry =
d->colorHash.find(
color);
55 if (hashEntry !=
d->colorHash.end()) {
56 auto historyEl = std::lower_bound(
d->history.begin(),
d->history.end(), *hashEntry, &
ColorEntry::less);
57 if (historyEl !=
d->history.end()) {
58 int oldPos = historyEl -
d->history.begin();
59 if (historyEl ==
d->history.begin()) {
64 d->history.erase(historyEl);
66 d->history.push_front(node);
70 qDebug() <<
"inconsistent color history state!";
75 if (
d->history.size() >=
d->maxSize) {
76 entry =
d->history.back();
77 d->history.pop_back();
80 entry->
key = ++
d->key;
86 d->colorHash.insert(
color, entry);
87 d->history.push_front(entry);
static bool less(const KisUniqueColorSet::ColorEntry *lhs, const KisUniqueColorSet::ColorEntry *rhs)