osc+notify: strcmp() -> streq()

This commit is contained in:
Daniel Eklöf 2024-07-24 16:04:14 +02:00
parent f56da385fe
commit a6bc9cafaf
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 13 additions and 13 deletions

View file

@ -220,7 +220,7 @@ notify_notify(struct terminal *term, struct notification *notif)
for (size_t i = 0; i < ALEN(term->notification_icons); i++) {
const struct notification_icon *icon = &term->notification_icons[i];
if (icon->id != NULL && strcmp(icon->id, notif->icon_id) == 0) {
if (icon->id != NULL && streq(icon->id, notif->icon_id)) {
icon_name_or_path = icon->symbolic_name != NULL
? icon->symbolic_name
: icon->tmp_file_name;
@ -378,7 +378,7 @@ notify_icon_add(struct terminal *term, const char *id,
#if defined(_DEBUG)
for (size_t i = 0; i < ALEN(term->notification_icons); i++) {
struct notification_icon *icon = &term->notification_icons[i];
if (icon->id != NULL && strcmp(icon->id, id) == 0) {
if (icon->id != NULL && streq(icon->id, id)) {
BUG("notification icon cache already contains \"%s\"", id);
}
}
@ -410,7 +410,7 @@ notify_icon_del(struct terminal *term, const char *id)
for (size_t i = 0; i < ALEN(term->notification_icons); i++) {
struct notification_icon *icon = &term->notification_icons[i];
if (icon->id == NULL || strcmp(icon->id, id) != 0)
if (icon->id == NULL || !streq(icon->id, id))
continue;
LOG_DBG("expelled %s from the notification icon cache", icon->id);