From 086a5f165096af104b01bb6d5639bd769bd17620 Mon Sep 17 00:00:00 2001 From: Dmitry Chestnykh Date: Wed, 21 Feb 2024 21:05:00 +0300 Subject: Remove unneeded comparisons. Inside `if` branches the conditions `as->ino == bs->ino` and `as->dev == bs->dev` are always false. Signed-off-by: Dmitry Chestnykh --- libpthread/nptl/sem_open.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libpthread/nptl/sem_open.c b/libpthread/nptl/sem_open.c index 2746da1b7..8c99d6dbe 100644 --- a/libpthread/nptl/sem_open.c +++ b/libpthread/nptl/sem_open.c @@ -147,11 +147,11 @@ __sem_search (const void *a, const void *b) if (as->ino != bs->ino) /* Cannot return the difference the type is larger than int. */ - return as->ino < bs->ino ? -1 : (as->ino == bs->ino ? 0 : 1); + return as->ino < bs->ino ? -1 : 1; if (as->dev != bs->dev) /* Cannot return the difference the type is larger than int. */ - return as->dev < bs->dev ? -1 : (as->dev == bs->dev ? 0 : 1); + return as->dev < bs->dev ? -1 : 1; return strcmp (as->name, bs->name); } -- cgit v1.2.3