Skip to content

Commit

Permalink
src: convert hex2bin() into a regular function
Browse files Browse the repository at this point in the history
No need to write hex2bin() as a function template because it's only
called with a char parameter.

Signed-off-by: Darshan Sen <raisinten@gmail.com>

PR-URL: #42321
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
RaisinTen authored Mar 18, 2022
1 parent 184af1c commit 57529b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/node_url.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@ void AppendOrEscape(std::string* str,
*str += ch;
}

template <typename T>
unsigned hex2bin(const T ch) {
unsigned hex2bin(const char ch) {
if (ch >= '0' && ch <= '9')
return ch - '0';
if (ch >= 'A' && ch <= 'F')
Expand Down

0 comments on commit 57529b2

Please sign in to comment.