emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master c4c5c49: Update stream.el to v2.0.5


From: Nicolas Petton
Subject: [elpa] master c4c5c49: Update stream.el to v2.0.5
Date: Wed, 04 Nov 2015 12:20:03 +0000

branch: master
commit c4c5c49cd8fcdb9fbb68bcfb727ffdb63cbdfe49
Author: Nicolas Petton <address@hidden>
Commit: Nicolas Petton <address@hidden>

    Update stream.el to v2.0.5
    
    * packages/stream/stream.el: Update.
---
 packages/stream/stream.el |   14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/packages/stream/stream.el b/packages/stream/stream.el
index 6bbf99f..61d99ee 100644
--- a/packages/stream/stream.el
+++ b/packages/stream/stream.el
@@ -4,7 +4,7 @@
 
 ;; Author: Nicolas Petton <address@hidden>
 ;; Keywords: stream, laziness, sequences
-;; Version: 2.0.2
+;; Version: 2.0.5
 ;; Package-Requires: ((emacs "25"))
 ;; Package: stream
 
@@ -119,8 +119,7 @@ The sequence starts at POS if non-nil, 1 otherwise."
      (with-current-buffer buffer
        (setq match (re-search-forward regexp nil t)))
      (when match
-       (cons (match-data) (stream-regexp buffer regexp))
-       nil))))
+       (cons (match-data) (stream-regexp buffer regexp))))))
 
 (defun stream-range (&optional start end step)
   "Return a stream of the integers from START to END, stepping by STEP.
@@ -257,12 +256,9 @@ This function will eagerly consume the entire stream."
 The elements of the produced stream are the results of the
 applications of FUNCTION on each element of STREAM in succession."
   (stream-make
-   ;; Avoid using `stream-empty-p', as it will consume the first element of the
-   ;; stream before iterating over the stream.
-   (let ((first (stream-first stream)))
-     (when first
-       (cons (funcall function first)
-             (seq-map function (stream-rest stream)))))))
+   (when (not (stream-empty-p stream))
+     (cons (funcall function (stream-first stream))
+           (seq-map function (stream-rest stream))))))
 
 (cl-defmethod seq-do (function (stream stream))
   "Evaluate FUNCTION for each element of STREAM eagerly, and return nil.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]