mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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:
1 parent
83391d185c
commit
73ce911a6f
1 file changed
+1
-2
+1
-2
@@ -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')
|
||||
|
||||
Reference in new issue
Block a user