From 57529b22c4a008ecdec1b9cae33c661dab4534a6 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Sat, 19 Mar 2022 01:27:32 +0530 Subject: [PATCH] src: convert hex2bin() into a regular function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need to write hex2bin() as a function template because it's only called with a char parameter. Signed-off-by: Darshan Sen PR-URL: https://github.com/nodejs/node/pull/42321 Reviewed-By: Tobias Nießen Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- src/node_url.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index 2541b95aa0c70d..9f22fa069804f5 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -222,8 +222,7 @@ void AppendOrEscape(std::string* str, *str += ch; } -template -unsigned hex2bin(const T ch) { +unsigned hex2bin(const char ch) { if (ch >= '0' && ch <= '9') return ch - '0'; if (ch >= 'A' && ch <= 'F')