From 44a55cf888336e7b44ea55b9b1b11424c1ad2d7f Mon Sep 17 00:00:00 2001 From: Luigi Pinca Date: Mon, 2 Oct 2017 09:20:06 +0200 Subject: [PATCH] url: const-ify first argument of ToUnicode function Fixes a compiler error on Windows. Refs: https://github.com/nodejs/node/pull/15615#issuecomment-333435350 --- 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 157adc3f63b37a..167a1887f30120 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -573,7 +573,7 @@ static inline int NormalizePort(std::string scheme, int p) { } #if defined(NODE_HAVE_I18N_SUPPORT) -static inline bool ToUnicode(std::string* input, std::string* output) { +static inline bool ToUnicode(const std::string* input, std::string* output) { MaybeStackBuffer buf; if (i18n::ToUnicode(&buf, input->c_str(), input->length()) < 0) return false; @@ -590,7 +590,7 @@ static inline bool ToASCII(std::string* input, std::string* output) { } #else // Intentional non-ops if ICU is not present. -static inline bool ToUnicode(std::string* input, std::string* output) { +static inline bool ToUnicode(const std::string* input, std::string* output) { *output = *input; return true; }