Also, rather use `static_cast<int>(stuff)` than `int(stuff)`.
See https://cdn.zneix.eu/JjHk5U4.png
This commit is contained in:
zneix 2021-07-31 02:28:00 +02:00
parent 52ef16418d
commit 4ba4a2f33c
No known key found for this signature in database
GPG key ID: 911916E0523B22F6
3 changed files with 6 additions and 4 deletions

View file

@ -888,7 +888,8 @@ QString CommandController::execCommand(const QString &textNoEmoji,
} }
} }
auto maxSpaces = std::min(this->maxSpaces_, int(words.length()) - 1); auto maxSpaces =
std::min(this->maxSpaces_, static_cast<int>(words.length() - 1));
for (int i = 0; i < maxSpaces; ++i) for (int i = 0; i < maxSpaces; ++i)
{ {
commandName += ' ' + words[i + 1]; commandName += ' ' + words[i + 1];

View file

@ -37,8 +37,8 @@ std::vector<QStringList> getEmoteSetBatches(QStringList emoteSetKeys)
{ {
QStringList batch; QStringList batch;
int last = int last = std::min(
std::min(batchSize, int(emoteSetKeys.size()) - batchSize * i); batchSize, static_cast<int>(emoteSetKeys.size() - batchSize * i));
for (int j = 0; j < last; j++) for (int j = 0; j < last; j++)
{ {
batch.push_back(emoteSetKeys.at(j + (batchSize * i))); batch.push_back(emoteSetKeys.at(j + (batchSize * i)));

View file

@ -791,7 +791,8 @@ void TwitchMessageBuilder::runIgnoreReplaces(
} }
twitchEmotes.push_back(TwitchEmoteOccurence{ twitchEmotes.push_back(TwitchEmoteOccurence{
startIndex + pos, startIndex + pos,
startIndex + pos + emote.first.string.length(), static_cast<int>(startIndex + pos +
emote.first.string.length()),
emote.second, emote.second,
emote.first, emote.first,
}); });