]> Repositorios git - scryer-prolog.git/commitdiff
ENHANCED: Use newly available fast chars test from library(error).
authorMarkus Triska <[email protected]>
Sun, 12 Dec 2021 16:37:59 +0000 (17:37 +0100)
committerMarkus Triska <[email protected]>
Sun, 12 Dec 2021 16:43:17 +0000 (17:43 +0100)
src/lib/pio.pl

index 262e8a5516e0f94562df0cf92ffafa8c61ab499a..38849a4b6ea50249500622942643c845c57dd509 100644 (file)
@@ -19,7 +19,7 @@
 :- use_module(library(dcgs)).
 :- use_module(library(error)).
 :- use_module(library(freeze)).
-:- use_module(library(iso_ext), [setup_call_cleanup/3, partial_string/1, partial_string/3]).
+:- use_module(library(iso_ext), [setup_call_cleanup/3, partial_string/3]).
 :- use_module(library(lists), [member/2, maplist/2]).
 :- use_module(library(charsio), [read_n_chars/3]).
 
@@ -87,11 +87,7 @@ reader_step(Stream, Pos, Xs0) :-
 
 phrase_to_stream(GRBody, Stream) :-
         phrase(GRBody, Cs),
-        (   partial_string(Cs) -> % very efficiently check for a string
-            true                  % (success is the expected case here)
-        ;   must_be(list, Cs),
-            maplist(must_be(character), Cs)
-        ),
+        must_be(chars, Cs),
         (   stream_property(Stream, type(binary)) ->
             (   '$first_non_octet'(Cs, N) ->
                 domain_error(byte_char, N, phrase_to_stream/2)