Commit bbfa93a
committed
url: refactor validateHostname
This function did not only validate the input but it returned a new value in case the hostname was valid. This simplifies the function by always returning the required value, no matter if it is valid or invalid, so the callee site does not have to check that anymore. On top the function is renamed to `getHostname` to make clear that the function does not only validate the input but it also returns a new value. PR-URL: #26809 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>1 parent ce26590 commit bbfa93a
1 file changed
+4
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
363 | | - | |
364 | | - | |
| 362 | + | |
365 | 363 | | |
366 | 364 | | |
367 | 365 | | |
| |||
462 | 460 | | |
463 | 461 | | |
464 | 462 | | |
465 | | - | |
| 463 | + | |
466 | 464 | | |
467 | 465 | | |
468 | 466 | | |
| |||
477 | 475 | | |
478 | 476 | | |
479 | 477 | | |
480 | | - | |
| 478 | + | |
481 | 479 | | |
482 | 480 | | |
| 481 | + | |
483 | 482 | | |
484 | 483 | | |
485 | 484 | | |
| |||
0 commit comments