neteja cppcheck (105 → 0)
This commit is contained in:
@@ -2,8 +2,9 @@
|
||||
|
||||
#include <SDL3/SDL.h> // Para SDL_RenderFillRect, SDL_FRect, SDL_RenderClear
|
||||
|
||||
#include <algorithm> // Para remove_if, min
|
||||
#include <string> // Para basic_string, string
|
||||
#include <algorithm> // Para ranges::transform, min
|
||||
#include <iterator> // Para back_inserter
|
||||
#include <string> // Para basic_string, string, erase_if
|
||||
#include <utility>
|
||||
#include <vector> // Para vector
|
||||
|
||||
@@ -77,7 +78,7 @@ void Notifier::playNotificationSoundIfNeeded(const Notification& notification) {
|
||||
}
|
||||
|
||||
void Notifier::updateNotificationState(int index, float delta_time) {
|
||||
auto& notification = notifications_[index];
|
||||
const auto& notification = notifications_[index];
|
||||
|
||||
switch (notification.state) {
|
||||
case State::RISING:
|
||||
@@ -167,7 +168,7 @@ void Notifier::show(std::vector<std::string> texts, int icon, const std::string&
|
||||
}
|
||||
|
||||
// Elimina las cadenas vacías
|
||||
texts.erase(std::ranges::remove_if(texts, [](const std::string& s) -> bool { return s.empty(); }).begin(), texts.end());
|
||||
std::erase_if(texts, [](const std::string& s) -> bool { return s.empty(); });
|
||||
|
||||
// Encuentra la cadena más larga
|
||||
std::string longest;
|
||||
@@ -303,8 +304,6 @@ void Notifier::clearAllNotifications() {
|
||||
auto Notifier::getCodes() -> std::vector<std::string> {
|
||||
std::vector<std::string> codes;
|
||||
codes.reserve(notifications_.size());
|
||||
for (const auto& notification : notifications_) {
|
||||
codes.emplace_back(notification.code);
|
||||
}
|
||||
std::ranges::transform(notifications_, std::back_inserter(codes), [](const auto& notification) { return notification.code; });
|
||||
return codes;
|
||||
}
|
||||
Reference in New Issue
Block a user