From 539addc61b620541379754846b2d56b9b07b1e0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rimas=20Misevi=C4=8Dius?= Date: Wed, 12 Apr 2017 22:59:08 +0300 Subject: [PATCH] IPv4 in IPv6: a bit better performance Follows https://github.com/whatwg/url/pull/292 Makes (1.) change; the (2.) optimization was done earlier. --- src/url_ip.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/url_ip.h b/src/url_ip.h index b4b3a09..cf31123 100644 --- a/src/url_ip.h +++ b/src/url_ip.h @@ -268,9 +268,9 @@ inline bool ipv6_parse(const CharT* first, const CharT* last, uint16_t(&pieces)[ if (value == 0) // leading zero return false; // TODO-ERR: validation error value = value * 10 + (*pointer - '0'); - pointer++; if (value > 255) return false; // TODO-ERR: validation error + pointer++; } pieces[piece_pointer] = pieces[piece_pointer] * 0x100 + value; numbers_seen++;