src: convert hex2bin() into a regular function

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: https://github.com/nodejs/node/pull/42321
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
Darshan Sen authored and Danielle Adams committed 2022-04-23 22:47:21 -04:00
1 parent 83391d185c
commit 73ce911a6f
1 file changed
+1 -2
+1 -2
View File
@@ -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')