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



commit 03e6c2950e67002015a8ed6c8c2bc17a660ef9cb
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 14553f2..dc6a581 100644
--- a/gee/priorityqueue.vala
+++ b/gee/priorityqueue.vala
@@ -1187,15 +1187,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]