chore: mini refactorings and dead code removal (#5512)

This commit is contained in:
nerix
2024-07-20 11:35:59 +02:00
committed by GitHub
parent deb4401036
commit b3c09b65d8
28 changed files with 65 additions and 506 deletions
+2 -3
View File
@@ -12,7 +12,6 @@
#include "providers/twitch/TwitchIrcServer.hpp"
#include "singletons/Settings.hpp"
#include "singletons/Theme.hpp"
#include "util/Clamp.hpp"
#include "util/Helpers.hpp"
#include "util/LayoutCreator.hpp"
#include "widgets/dialogs/EmotePopup.hpp"
@@ -811,7 +810,7 @@ void SplitInput::updateCompletionPopup()
return;
}
for (int i = clamp(position, 0, (int)text.length() - 1); i >= 0; i--)
for (int i = std::clamp(position, 0, (int)text.length() - 1); i >= 0; i--)
{
if (text[i] == ' ')
{
@@ -894,7 +893,7 @@ void SplitInput::insertCompletionText(const QString &input_) const
auto text = edit.toPlainText();
auto position = edit.textCursor().position() - 1;
for (int i = clamp(position, 0, (int)text.length() - 1); i >= 0; i--)
for (int i = std::clamp(position, 0, (int)text.length() - 1); i >= 0; i--)
{
bool done = false;
if (text[i] == ':')