Skip to content

Commit

Permalink
src: slightly simplify URLHost::ToString
Browse files Browse the repository at this point in the history
PR-URL: #41747
Reviewed-By: Darshan Sen <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Mohammed Keyvanzadeh <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Mestery <[email protected]>
Reviewed-By: Mary Marchini <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and ruyadorno committed Feb 8, 2022
1 parent 43f2aba commit c3d3abf
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,7 @@ std::string URLHost::ToString() const {
dest.reserve(15);
uint32_t value = value_.ipv4;
for (int n = 0; n < 4; n++) {
char buf[4];
snprintf(buf, sizeof(buf), "%d", value % 256);
dest.insert(0, buf);
dest.insert(0, std::to_string(value % 256));
if (n < 3)
dest.insert(0, 1, '.');
value /= 256;
Expand Down

0 comments on commit c3d3abf

Please sign in to comment.