mirror of
https://github.com/nodejs/node.git
synced 2026-11-29 14:27:57 -05:00
src: slightly simplify URLHost::ToString
PR-URL: https://github.com/nodejs/node/pull/41747 Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: Mary Marchini <oss@mmarchini.me> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
206c370d03
commit
5e595683ce
1 file changed
+1
-3
+1
-3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user