From c9f7fcb12e62a6bd469cca697e983300f213a9c2 Mon Sep 17 00:00:00 2001 From: cage Date: Sun, 4 Jun 2023 14:02:05 +0200 Subject: [PATCH] - fixed test to check if acharacter is an emoji. - returned the whole codepoints list if a char is an emoji. --- src/emoji-matcher.lisp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/emoji-matcher.lisp b/src/emoji-matcher.lisp index 5089f26..6a9dc69 100644 --- a/src/emoji-matcher.lisp +++ b/src/emoji-matcher.lisp @@ -11,8 +11,9 @@ (not (cl-ppcre:scan "^#" line)))) (defun match-codepoint-p (a b) - (every #'char= a - (mapcar #'code-char b))) + (alexandria:set-equal a + (mapcar #'code-char b) + :test #'char=)) (defun extract-codepoints (stream) "Extract shotcodes from the emoji table file" @@ -1295,8 +1296,8 @@ (defgeneric emojip (codepoints-chars)) (defmethod emojip ((codepoints-chars list)) - (first (or (emoji-zwj-sequences-p codepoints-chars) - (emoji-sequences-p codepoints-chars)))) + (or (emoji-zwj-sequences-p codepoints-chars) + (emoji-sequences-p codepoints-chars))) (defgeneric starting-emoji (object))