Dict: Use the that pattern for a non-const this
diff --git a/poppler/Dict.cc b/poppler/Dict.cc
index 524a862..77b8ee1 100644
--- a/poppler/Dict.cc
+++ b/poppler/Dict.cc
@@ -98,11 +98,10 @@
if (!sorted) {
dictLocker();
if (!sorted) {
- auto& entries = const_cast<std::vector<DictEntry>&>(this->entries);
- auto& sorted = const_cast<std::atomic_bool&>(this->sorted);
+ Dict *that = const_cast<Dict*>(this);
- std::sort(entries.begin(), entries.end(), CmpDictEntry{});
- sorted = true;
+ std::sort(that->entries.begin(), that->entries.end(), CmpDictEntry{});
+ that->sorted = true;
}
}
}