Patchwork nss: Simplify if expression in getaddrinfo()

login
register
mail settings
Submitter Tim Rühsen
Date Nov. 23, 2019, 7:15 p.m.
Message ID <eebe8665-f702-2402-6da7-fd965531602b@gmx.de>
Download mbox | patch
Permalink /patch/36157/
State New
Headers show

Comments

Tim Rühsen - Nov. 23, 2019, 7:15 p.m.
Small code cleanup for better readability.

Patch

From 8184e419b971c801c2e708274e59a189892b5a7a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de>
Date: Sat, 23 Nov 2019 19:08:26 +0100
Subject: [PATCH] nss: Simplify if expression in getaddrinfo()

* sysdeps/posix/getaddrinfo.c (getaddrinfo):
  Simplify if expression
---
 sysdeps/posix/getaddrinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c
index ea127877cb..afdcdf0a3b 100644
--- a/sysdeps/posix/getaddrinfo.c
+++ b/sysdeps/posix/getaddrinfo.c
@@ -2206,7 +2206,7 @@  getaddrinfo (const char *name, const char *service,
 	{
 	  /* If we haven't seen both IPv4 and IPv6 interfaces we can
 	     narrow down the search.  */
-	  if ((! seen_ipv4 || ! seen_ipv6) && (seen_ipv4 || seen_ipv6))
+	  if (seen_ipv4 != seen_ipv6)
 	    {
 	      local_hints = *hints;
 	      local_hints.ai_family = seen_ipv4 ? PF_INET : PF_INET6;
--
2.24.0