From 73c5c94ba163dd66fd02eb9165d5667d69d53e28 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 12 Jan 2019 13:03:05 -0800 Subject: [PATCH] Eliminate unnecessary consing in char-set-empty?. --- src/runtime/char-set.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/runtime/char-set.scm b/src/runtime/char-set.scm index 0f4277c2e..bca760cb0 100644 --- a/src/runtime/char-set.scm +++ b/src/runtime/char-set.scm @@ -446,6 +446,10 @@ USA. (%char-set-high char-set)))) char-sets)) +(define (char-set-empty? cs) + (and (fix:= 0 (bytevector-length (%char-set-low cs))) + (fix:= 0 (bytevector-length (%char-set-high cs))))) + (define (char-set-hash char-set) (primitive-object-hash-2 (%char-set-low char-set) (%char-set-high char-set))) @@ -458,9 +462,6 @@ USA. ranges)) (reverse! ranges)))) -(define (char-set-empty? cs) - (char-set=? (char-set) cs)) - (define (char-sets-disjoint? char-set . char-sets) (every (lambda (char-set*) (char-set-empty? (char-set-intersection char-set char-set*))) -- 2.25.1