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:
4ff3633
)
Add Gee.ArrayQueue.foreach implementation
author
Maciej Piechotka
<uzytkownik2@gmail.com>
Mon, 15 Jul 2013 23:01:09 +0000
(
01:01
+0200)
committer
Maciej Piechotka
<uzytkownik2@gmail.com>
Mon, 15 Jul 2013 23:01:09 +0000
(
01:01
+0200)
gee/arrayqueue.vala
patch
|
blob
|
history
diff --git
a/gee/arrayqueue.vala
b/gee/arrayqueue.vala
index
9806a65
..
ea1a806
100644
(file)
--- a/
gee/arrayqueue.vala
+++ b/
gee/arrayqueue.vala
@@
-127,6
+127,18
@@
public class Gee.ArrayQueue<G> : Gee.AbstractQueue<G>, Deque<G> {
/**
* {@inheritDoc}
*/
+ public override bool foreach (ForallFunc<G> f) {
+ for (int i = 0; i < _length; i++) {
+ if (!f (_items[(_start + i) % _items.length])) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
public override G? peek () {
return peek_head ();
}