From 046fd987e4a0102e60c835c2286dfff5cb86cde1 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Sat, 6 Oct 2018 16:13:39 -0400 Subject: [PATCH] src: reduce variable scope in node_url.cc PR-URL: https://github.com/nodejs/node/pull/23297 Reviewed-By: Anna Henningsen Reviewed-By: Joyee Cheung Reviewed-By: Refael Ackermann Reviewed-By: Gabriel Schulhof Reviewed-By: Trivikram Kamat Reviewed-By: Ruben Bridgewater Reviewed-By: James M Snell --- src/node_url.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index acc423d931b603..f0278a5cf3d20b 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -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] != ':') @@ -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;