diff options
author | Thomas Voss <mail@thomasvoss.com> | 2024-03-15 13:05:09 +0100 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2024-03-15 13:05:09 +0100 |
commit | fd3b4c38ad9cf702f68bd0138c9ea0b76a25208b (patch) | |
tree | 6e8ad5dc95adc4523540c6340c06bcebfdc54ea8 | |
parent | cd9686e6bef2c69f0852d5ff84453b18111ef407 (diff) |
Add DAPOP()
-rw-r--r-- | include/dynarr.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/dynarr.h b/include/dynarr.h index 3785e18..76307e5 100644 --- a/include/dynarr.h +++ b/include/dynarr.h @@ -34,7 +34,9 @@ (a)->len += (n); \ } while (false) -#define DAREMOVE(da, i) DA_REMOVE_RANGE((a), (i), (i) + 1) +#define DAPOP(da) ((da)->buf[--(da)->len]) + +#define DAREMOVE(da, i) DA_REMOVE_RANGE((da), (i), (i) + 1) #define DA_REMOVE_RANGE(da, i, j) \ do { \ |