diff options
-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 48502fb4c8c..29997c78ee8 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? |