summaryrefslogtreecommitdiffstats
path: root/src/glsl/list.h
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-08-16 18:02:11 -0700
committerIan Romanick <[email protected]>2010-09-03 11:55:21 -0700
commit29eebe9a9a0486f12e33e2818c192ef683fdfede (patch)
tree6acbadd70415e49c2381e101a8aef1de862778e2 /src/glsl/list.h
parent9710d272f71c95c8145999a31e2c47e1977c698e (diff)
exec_list: Add pop_head
Diffstat (limited to 'src/glsl/list.h')
-rw-r--r--src/glsl/list.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/glsl/list.h b/src/glsl/list.h
index a70b79d571f..76477743106 100644
--- a/src/glsl/list.h
+++ b/src/glsl/list.h
@@ -378,6 +378,23 @@ struct exec_list {
}
/**
+ * Remove the first node from a list and return it
+ *
+ * \return
+ * The first node in the list or \c NULL if the list is empty.
+ *
+ * \sa exec_list::get_head
+ */
+ exec_node *pop_head()
+ {
+ exec_node *const n = this->get_head();
+ if (n != NULL)
+ n->remove();
+
+ return n;
+ }
+
+ /**
* Move all of the nodes from this list to the target list
*/
void move_nodes_to(exec_list *target)