Skip to content

Commit

Permalink
IPv4 in IPv6: a bit better performance
Browse files Browse the repository at this point in the history
Follows whatwg/url#292
Makes (1.) change; the (2.) optimization was done earlier.
  • Loading branch information
rmisev committed Apr 12, 2017
1 parent 3ebfad0 commit 539addc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/url_ip.h
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down

0 comments on commit 539addc

Please sign in to comment.