]> Repositorios git - scryer-prolog.git/commitdiff
use partial_string/1 for much quicker test
authorMarkus Triska <[email protected]>
Wed, 3 Nov 2021 21:35:47 +0000 (22:35 +0100)
committerMarkus Triska <[email protected]>
Wed, 3 Nov 2021 23:12:00 +0000 (00:12 +0100)
src/lib/crypto.pl

index a6f7ad0ec709bbbab0957c438ed128348ec2d41a..3d19a72bd9d72d152238d40dda9aeb6e17f88514 100644 (file)
@@ -620,8 +620,11 @@ encoding_chars(octet, Bs, Cs) :-
         ),
         must_be_byte_chars(Cs, crypto_encoding).
 encoding_chars(utf8, Cs, Cs) :-
-        must_be(list, Cs),
-        maplist(must_be(character), Cs).
+        (   partial_string(Cs) ->
+            true
+        ;   must_be(list, Cs),
+            maplist(must_be(character), Cs)
+        ).
 
 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Digital signatures with Ed25519