Commit 3c4541f
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 77682b5 commit 3c4541f
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | | - | |
| 82 | + | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments