Improve performance for ip parse

This commit is contained in:
crschnick
2026-09-09 20:06:44 +00:00
parent 8f05cb8606
commit 06845b8bda
@@ -49,6 +49,11 @@ public class HostHelper {
}
public static Optional<Inet4Address> parseIpv4(String host) {
var potential = host.chars().allMatch(value -> Character.isDigit(value) || value == '.');
if (!potential) {
return Optional.empty();
}
Inet4Address inet4Address;
try {
inet4Address = Inet4Address.ofLiteral(host);