From ea54b10f1d3dc4b4d5ba7843e34370a5d7cdb4bf Mon Sep 17 00:00:00 2001 From: fourtf Date: Sat, 22 Aug 2020 23:22:00 +0200 Subject: [PATCH] smol fix --- src/widgets/splits/EmoteInputPopup.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/widgets/splits/EmoteInputPopup.cpp b/src/widgets/splits/EmoteInputPopup.cpp index 2445d75bd..dd26d1f61 100644 --- a/src/widgets/splits/EmoteInputPopup.cpp +++ b/src/widgets/splits/EmoteInputPopup.cpp @@ -95,7 +95,7 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel) } // if there is an exact match, put that emote first - for (int i = 1; i < (int)emotes.size(); i++) + for (size_t i = 1; i < emotes.size(); i++) { auto emoteText = emotes.at(i).displayName; @@ -103,7 +103,9 @@ void EmoteInputPopup::updateEmotes(const QString &text, ChannelPtr channel) if (emoteText.compare(text, Qt::CaseInsensitive) == 0 || emoteText.compare(":" + text, Qt::CaseInsensitive) == 0) { - std::iter_swap(emotes.begin(), emotes.begin() + i); + auto emote = emotes[i]; + emotes.erase(emotes.begin() + int(i)); + emotes.insert(emotes.begin(), emote); break; } }