Skip to content

Commit

Permalink
src: reduce variable scope in node_url.cc
Browse files Browse the repository at this point in the history
PR-URL: #23297
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
cjihrig authored and targos committed Oct 10, 2018
1 parent 36c4307 commit 046fd98
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -792,7 +792,7 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) {
uint16_t* compress_pointer = nullptr;
const char* pointer = input;
const char* end = pointer + length;
unsigned value, len, swaps, numbers_seen;
unsigned value, len, numbers_seen;
char ch = pointer < end ? pointer[0] : kEOL;
if (ch == ':') {
if (length < 2 || pointer[1] != ':')
Expand Down Expand Up @@ -881,7 +881,7 @@ void URLHost::ParseIPv6Host(const char* input, size_t length) {
}

if (compress_pointer != nullptr) {
swaps = piece_pointer - compress_pointer;
unsigned swaps = piece_pointer - compress_pointer;
piece_pointer = buffer_end - 1;
while (piece_pointer != &value_.ipv6[0] && swaps > 0) {
uint16_t temp = *piece_pointer;
Expand Down

0 comments on commit 046fd98

Please sign in to comment.