[libgee/0.10] Fix the PriorityQueue.Iterator.foreach



commit 265c3997b414b102e076dafa8021c30cffc2fa11
Author: Maciej Piechotka <uzytkownik2 gmail com>
Date:   Mon Jul 15 19:36:51 2013 +0200

    Fix the PriorityQueue.Iterator.foreach

 gee/priorityqueue.vala |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/gee/priorityqueue.vala b/gee/priorityqueue.vala
index d0c5d6b..d6f6abe 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -1188,15 +1188,18 @@ public class Gee.PriorityQueue<G> : Gee.AbstractQueue<G> {
                        stamp++;
                        assert (stamp == queue._stamp);
                }
-               
+
                public bool read_only { get { return false; } }
-               
+
                public bool valid { get { return position != null; } }
 
                public bool foreach (ForallFunc<G> f) {
                        if (position == null) {
                                position = (previous != null) ? previous.iter_next : queue._iter_head;
                        }
+                       if (position == null) {
+                               return true;
+                       }
                        if (!f (position.data)) {
                                return false;
                        }


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