Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
src: slightly simplify URLHost::ToString
  • Loading branch information
addaleax committed Jan 29, 2022
commit 6d5b5460e7fcfdcf6cc4a9044b99f2ff4c4f6a03
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