Optimitzat el tema de comparacions i asignacions de strings buits. Mes que optimitzat, ara està mes mono
This commit is contained in:
@@ -147,18 +147,19 @@ void Notify::clearFinishedNotifications()
|
||||
void Notify::showText(std::string text1, std::string text2, int icon)
|
||||
{
|
||||
// Cuenta el número de textos a mostrar
|
||||
const int numTexts = (text1 != "") + (text2 != "");
|
||||
const int numTexts = !text1.empty() + !text2.empty();
|
||||
|
||||
// Si no hay texto, acaba
|
||||
if (numTexts == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Si solo hay un texto, lo coloca en la primera variable
|
||||
else if (numTexts == 1)
|
||||
if (numTexts == 1)
|
||||
{
|
||||
text1 = text1 + text2;
|
||||
text2 = "";
|
||||
text1 += text2;
|
||||
text2.clear();
|
||||
}
|
||||
|
||||
// Si las notificaciones no se apilan, elimina las anteriores
|
||||
|
||||
Reference in New Issue
Block a user