diff options
Diffstat (limited to 'collections/double_ended_queue.c')
-rw-r--r-- | collections/double_ended_queue.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/collections/double_ended_queue.c b/collections/double_ended_queue.c index 6a3a810..1f18330 100644 --- a/collections/double_ended_queue.c +++ b/collections/double_ended_queue.c @@ -181,3 +181,14 @@ int i, j; root->end[j] = root->end[i]; root->end[i] = tmp; } + +void deq_truncate(root, size) +deq *root; +int size; +{ + if ((!root) || size > deq_size(root)) { + return; + } + + root->end = root->beg + size; +} |