summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorMisaki Shioi <31817032+shioimm@users.noreply.github.com>2025-12-28 17:23:50 +0900
committerGitHub <noreply@github.com>2025-12-28 17:23:50 +0900
commit3fe2ebf8e4127bca0a57d4ed8eb6035792420a26 (patch)
tree104e22cb97a76743775f0ec2e153cfcc9a80d8ec /ext
parent6544c89708d94b894012e0587f770f33bbce4a3b (diff)
Remove unnecessary comparison from is_local_port_fixed (#15757)
Simplify the conditions: - Return false if the port is 0 or a negative number - Return true if the port is a positive number
Diffstat (limited to 'ext')
-rw-r--r--ext/socket/ipsocket.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/socket/ipsocket.c b/ext/socket/ipsocket.c
index 758d37293f..931a1a629c 100644
--- a/ext/socket/ipsocket.c
+++ b/ext/socket/ipsocket.c
@@ -269,9 +269,8 @@ is_local_port_fixed(const char *portp)
if (endp == portp) return 0;
if (errno == ERANGE) return 0;
- if (port <= 0) return 0;
- return port != 0;
+ return port > 0;
}
struct fast_fallback_inetsock_arg