Commit 9a12f71
lib: simplify IPv6 checks in isLoopback()
The checks for '[::1]' and '[0:0:0:0:0:0:0:1]'
in isLoopback were using startsWith,
which is unnecessary as these are canonical
loopback addresses with no valid prefixes.
Switching to strict equality improves
clarity and improves performance.
PR-URL: #59375
Reviewed-By: Tim Perry <[email protected]>
Reviewed-By: theanarkh <[email protected]>
Reviewed-By: Ethan Arrowood <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Ulises Gascón <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Stefan Stojanovic <[email protected]>1 parent 52ab64e commit 9a12f71
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
96 | | - | |
97 | | - | |
| 96 | + | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
0 commit comments