diff options
author | Teddy Wing | 2021-01-30 17:02:07 +0100 |
---|---|---|
committer | Teddy Wing | 2021-01-30 17:02:07 +0100 |
commit | 3730abd661d8d92a38fc88f62720eb0eb80cc1a9 (patch) | |
tree | 2291c6152d42ca5f3812b06b7684af0f9867bda3 /l/src/main.lisp | |
parent | 8b0060a6b029eb5600abe0d8187c28d354dd7a33 (diff) | |
download | extreload-3730abd661d8d92a38fc88f62720eb0eb80cc1a9.tar.bz2 |
main.lisp: Use `find-if` in `requested-extension-p`
I've been reading Practical Common Lisp's "Collections" chapter
(http://www.gigamonkeys.com/book/collections.html) and it seemed like
`find-if` would be nicer here than what I wrote before.
Diffstat (limited to 'l/src/main.lisp')
-rw-r--r-- | l/src/main.lisp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/l/src/main.lisp b/l/src/main.lisp index a75fbc3..6abe363 100644 --- a/l/src/main.lisp +++ b/l/src/main.lisp @@ -66,13 +66,12 @@ (defun reload-extensions (targets extension-ids) (labels ((requested-extension-p (target) - (dolist (id extension-ids) - (if (uiop:string-prefix-p + (find-if + #'(lambda (id) + (uiop:string-prefix-p (concatenate 'string "chrome-extension://" id) - (json-obj-get target "url")) - (return-from requested-extension-p t))) - - nil)) + (json-obj-get target "url"))) + extension-ids))) (dolist (extension (filter #'requested-extension-p targets)) (attach-to-target extension)))) |