From 7c40a3205439e406d54feca6cd0a09fda091522c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 4 Jun 2010 16:35:42 -0700 Subject: Add queries to determine if a node is a list sentinal --- list.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/list.h b/list.h index 615be05437..0b91647be4 100644 --- a/list.h +++ b/list.h @@ -140,6 +140,22 @@ struct exec_node { this->prev->next = before; this->prev = before; } + + /** + * Is this the sentinal at the tail of the list? + */ + bool is_tail_sentinal() const + { + return this->next == NULL; + } + + /** + * Is this the sentinal at the head of the list? + */ + bool is_head_sentinal() const + { + return this->prev == NULL; + } #endif }; -- cgit v1.2.3