Permalink
Browse files

treat nil correctly

requires pcache 0.2.2
  • Loading branch information...
sigma committed Jan 8, 2012
1 parent d8ee3f2 commit 220ca2ebee10a6d674aef6ea5e5ee32458672e73
Showing with 6 additions and 4 deletions.
  1. +5 −3 gh-api.el
  2. +1 −1 gh-pkg.el
View
@@ -185,9 +185,11 @@
(list resource
method
(sha1 (format "%s" transformer)))))
(value (and key (pcache-get cache key)))
(has-value (and key (pcache-has cache key)))
(value (and has-value (pcache-get cache key)))
(req
(and (not value) ;; we'll need the req only if value's not in cache
(and (not has-value) ;; we'll need the req only if value's not
;; already in cache
(gh-auth-modify-request
(oref api :auth)
(gh-api-request "request"
@@ -204,7 +206,7 @@
(and (eq fmt :form)
(gh-api-form-encode data))
""))))))
(cond (value ;; got value from cache
(cond (has-value ;; got value from cache
(gh-api-response "cached" :data value))
(key ;; no value, but cache exists and method is safe
(let ((resp (gh-api-run-request api req transformer)))
View
@@ -1 +1 @@
(define-package "gh" "%VERSION%" "A GitHub library for Emacs" '((pcache "0.2.1")))
(define-package "gh" "%VERSION%" "A GitHub library for Emacs" '((pcache "0.2.2")))

0 comments on commit 220ca2e

Please sign in to comment.