]> Repositorios git - scryer-prolog.git/commitdiff
use newly available must_be(chars, ...) for better and shorter type test
authorMarkus Triska <[email protected]>
Sat, 3 Sep 2022 17:58:51 +0000 (19:58 +0200)
committerMark Thom <[email protected]>
Thu, 27 Oct 2022 05:36:07 +0000 (23:36 -0600)
src/lib/crypto.pl

index 25b5ebb6aa0deb5c584682712a66572d61260017..6473e0d1ad11d55b314d12f55d9cf09de7affc40 100644 (file)
@@ -65,8 +65,7 @@
 
 hex_bytes(Hs, Bytes) :-
         (   ground(Hs) ->
-            must_be(list, Hs),
-            maplist(must_be(atom), Hs),
+            must_be(chars, Hs),
             (   phrase(hex_bytes(Hs), Bytes) ->
                 true
             ;   domain_error(hex_encoding, Hs, hex_bytes/2)