nickva commented on code in PR #4091:
URL: https://github.com/apache/couchdb/pull/4091#discussion_r915067040


##########
src/couch/src/couch_util.erl:
##########
@@ -212,29 +212,36 @@ validate_utf8_fast(B, O) ->
             false
     end.
 
-to_hex(<<Hi:4, Lo:4, Rest/binary>>) ->
-    [nibble_to_hex(Hi), nibble_to_hex(Lo) | to_hex(Rest)];
-to_hex(<<>>) ->
-    [];
+to_hex(Binary) when is_binary(Binary) ->
+    binary_to_list(to_hex_bin(Binary));
 to_hex(List) when is_list(List) ->
     to_hex(list_to_binary(List)).

Review Comment:
   Oh, it does look silly this way. I'd just have it call to_hex_bin/1 directly 
it would look cleaner that way.
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to