projects
/
platform
/
upstream
/
libgee.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
663d02a
)
Fix default Traversable.stream implementation for Iterator<G>
author
Maciej Piechotka
<uzytkownik2@gmail.com>
Wed, 17 Aug 2011 20:43:34 +0000
(21:43 +0100)
committer
Maciej Piechotka
<uzytkownik2@gmail.com>
Wed, 17 Aug 2011 20:43:34 +0000
(21:43 +0100)
The implementation assumed in unfolding function that the stream some
value - however it might not be the case.
gee/iterator.vala
patch
|
blob
|
history
diff --git
a/gee/iterator.vala
b/gee/iterator.vala
index
a52f257
..
b7d51af
100644
(file)
--- a/
gee/iterator.vala
+++ b/
gee/iterator.vala
@@
-115,8
+115,9
@@
public interface Gee.Iterator<G> : Object, Traversable<G> {
assert_not_reached ();
}
return unfold<A> (() => {
- Lazy<A>? val;
- str = f (Traversable.Stream.YIELD, null, out val);
+ Lazy<A>? val = null;
+ if (str != Traversable.Stream.CONTINUE)
+ str = f (Traversable.Stream.YIELD, null, out val);
while (str == Traversable.Stream.CONTINUE) {
if (need_next) {
if (!self.next ()) {