Просмотр исходного кода

Simplify PAGE-URL's around method.

Brit Butler лет назад: 11
Родитель
Сommit
669655930b
1 измененных файлов с 3 добавлено и 4 удалено
  1. 3 4
      src/documents.lisp

+ 3 - 4
src/documents.lisp

@@ -35,10 +35,9 @@
35 35
           (error "No routing method found for: ~A" class-name)))))
36 36
 
37 37
 (defmethod page-url :around ((document t))
38
-  (let ((result (call-next-method)))
39
-    (if (pathname-type result)
40
-        (make-pathname :defaults result)
41
-        (make-pathname :type "html" :defaults result))))
38
+  (let* ((result (call-next-method))
39
+         (type (or (pathname-type result) "html")))
40
+    (make-pathname :type type :defaults result)))
42 41
 
43 42
 (defgeneric render (document &key &allow-other-keys)
44 43
   (:documentation "Render the given DOCUMENT to HTML."))