diff options
author | Timothy Gu <timothygu99@gmail.com> | 2017-03-16 16:46:12 -0700 |
---|---|---|
committer | Timothy Gu <timothygu99@gmail.com> | 2017-03-21 17:45:54 -0700 |
commit | d23123643d98165c67ad51d1fdecf06486b1c6d9 (patch) | |
tree | ff32e7abb19b78301a3a7c7b8697e2d20ce712ea /src/node_url.h | |
parent | c515a985ea77495986391dada7baaffcc144b197 (diff) | |
download | node-new-d23123643d98165c67ad51d1fdecf06486b1c6d9.tar.gz |
src: make PercentDecode return void
It only returns 0, nor is it likely to have any error conditions in the
future.
PR-URL: https://github.com/nodejs/node/pull/11922
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/node_url.h')
-rw-r--r-- | src/node_url.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/node_url.h b/src/node_url.h index 198c29938b..ba05cd6fed 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -376,11 +376,11 @@ static inline unsigned hex2bin(const char ch) { return static_cast<unsigned>(-1); } -static inline int PercentDecode(const char* input, - size_t len, - std::string* dest) { +static inline void PercentDecode(const char* input, + size_t len, + std::string* dest) { if (len == 0) - return 0; + return; dest->reserve(len); const char* pointer = input; const char* end = input + len; @@ -399,11 +399,10 @@ static inline int PercentDecode(const char* input, unsigned a = hex2bin(pointer[1]); unsigned b = hex2bin(pointer[2]); char c = static_cast<char>(a * 16 + b); - *dest += static_cast<char>(c); + *dest += c; pointer += 3; } } - return 0; } #define SPECIALS(XX) \ |