diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2010-07-14 12:14:26 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2010-07-14 16:49:24 -0700 |
commit | 1fdcdb2dca97cdf4b8f4790aa66587ff3e89e526 (patch) | |
tree | ce95452a087ca1a5117f72cfb7958faa70bc0922 | |
parent | 53120805a83a834349a96515d8e2dcbd622d06db (diff) |
exec_list: Add a new replace_with method.
-rw-r--r-- | src/glsl/list.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/list.h b/src/glsl/list.h index 48502fb4c8..29997c78ee 100644 --- a/src/glsl/list.h +++ b/src/glsl/list.h @@ -165,6 +165,17 @@ struct exec_node { this->prev->next = before; this->prev = before; } + /** + * Replace the current node with the given node. + */ + void replace_with(exec_node *replacement) + { + replacement->prev = this->prev; + replacement->next = this->next; + + this->prev->next = replacement; + this->next->prev = replacement; + } /** * Is this the sentinal at the tail of the list? |