You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2015/01/23 21:20:26 UTC
[02/10] storm git commit: Revert "delete 'some?',
change 'zip-contains-dir?'. make
storm-core/src/clj/backtype/storm/util.clj compatible with clojure 1.6. in
fact zip-contains-dir? use some? will include empty zip file."
Revert "delete 'some?', change 'zip-contains-dir?'. make storm-core/src/clj/backtype/storm/util.clj compatible with clojure 1.6. in fact zip-contains-dir? use some? will include empty zip file."
This reverts commit e738e27ed8a24b30143c229a3b8405271372ca23.
Project: http://git-wip-us.apache.org/repos/asf/storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/c0e51a28
Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/c0e51a28
Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/c0e51a28
Branch: refs/heads/master
Commit: c0e51a281f3de5715e8108e9f556e32a0f501f79
Parents: e738e27
Author: joe <ta...@gmail.com>
Authored: Tue Oct 7 08:41:05 2014 +0800
Committer: joe <ta...@gmail.com>
Committed: Tue Oct 7 08:41:05 2014 +0800
----------------------------------------------------------------------
storm-core/src/clj/backtype/storm/util.clj | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/storm/blob/c0e51a28/storm-core/src/clj/backtype/storm/util.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/util.clj b/storm-core/src/clj/backtype/storm/util.clj
index c908783..398584f 100644
--- a/storm-core/src/clj/backtype/storm/util.clj
+++ b/storm-core/src/clj/backtype/storm/util.clj
@@ -566,6 +566,10 @@
(while (not (apredicate))
(Time/sleep 100)))
+(defn some?
+ [pred aseq]
+ ((complement nil?) (some pred aseq)))
+
(defn time-delta
[time-secs]
(- (current-time-secs) time-secs))
@@ -799,7 +803,7 @@
(defn zip-contains-dir?
[zipfile target]
(let [entries (->> zipfile (ZipFile.) .entries enumeration-seq (map (memfn getName)))]
- (some #(.startsWith % (str target "/")) entries)))
+ (some? #(.startsWith % (str target "/")) entries)))
(defn url-encode
[s]