瀏覽代碼

fix concurency

Innocenty Enikeew 8 年之前
父節點
當前提交
70b0429eca
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      travels.lisp

+ 4 - 2
travels.lisp

@@ -71,8 +71,10 @@
 (defparameter +200-empty+ '(200 (:content-type "application/json")
                             #.(trivial-utf-8:string-to-utf-8-bytes "{}")))
 
-(defvar *200* '(200 (:content-type "application/json") content))
-(defun 200-json (data) (setf (caddr *200*) (dumps data)) *200*)
+(defun 200-json (data)
+  (declare (optimize (speed 3) (safety 0))
+           (type list data))
+  `(200 (:content-type "application/json") ,(dumps data)))
 
 (defun get-entity (params)
   (let ((id (parse-integer (getf params :id) :junk-allowed t))