Skip to content

Commit c3d3abf

Browse files
addaleaxruyadorno
authored andcommitted
src: slightly simplify URLHost::ToString
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]>
1 parent 43f2aba commit c3d3abf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/node_url.cc

+1-3
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,7 @@ std::string URLHost::ToString() const {
582582
dest.reserve(15);
583583
uint32_t value = value_.ipv4;
584584
for (int n = 0; n < 4; n++) {
585-
char buf[4];
586-
snprintf(buf, sizeof(buf), "%d", value % 256);
587-
dest.insert(0, buf);
585+
dest.insert(0, std::to_string(value % 256));
588586
if (n < 3)
589587
dest.insert(0, 1, '.');
590588
value /= 256;

0 commit comments

Comments
 (0)