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 and danielleadams committed Apr 24, 2022
1 parent 83391d1 commit 73ce911
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 73ce911

Please sign in to comment.