fix: Duplicate pattern data view entries when sorting the list

Fixes #584
This commit is contained in:
WerWolv 2022-07-18 11:40:49 +02:00
parent 2fb51d1a56
commit fe86f69da3
1 changed files with 1 additions and 0 deletions

View File

@ -80,6 +80,7 @@ namespace hex::plugin::builtin {
auto sortSpecs = ImGui::TableGetSortSpecs();
if (sortSpecs->SpecsDirty || sortedPatterns.empty()) {
sortedPatterns.clear();
std::transform(patterns.begin(), patterns.end(), std::back_inserter(sortedPatterns), [](const std::shared_ptr<pl::Pattern> &pattern) {
return pattern.get();
});