diff options
| author | Tyge Løvset <[email protected]> | 2022-09-23 12:32:02 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-09-23 12:32:02 +0200 |
| commit | 0ec40a5819a619b6b2777f24c555a8953e99ea9b (patch) | |
| tree | 71849156f92044f14c11ebf14716afde8a46b7e3 /include/stc/clist.h | |
| parent | 1d7da47d207c2ce569367cac66f56e22344bab1c (diff) | |
| download | STC-modified-0ec40a5819a619b6b2777f24c555a8953e99ea9b.tar.gz STC-modified-0ec40a5819a619b6b2777f24c555a8953e99ea9b.zip | |
Added assert() checks in pop-functions.
Diffstat (limited to 'include/stc/clist.h')
| -rw-r--r-- | include/stc/clist.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/stc/clist.h b/include/stc/clist.h index 7e47f7b7..b5939029 100644 --- a/include/stc/clist.h +++ b/include/stc/clist.h @@ -140,7 +140,7 @@ STC_INLINE void _cx_memb(_clear)(_cx_self* self) { _cx_memb(_drop)(self) STC_INLINE _cx_value* _cx_memb(_push)(_cx_self* self, i_key value) { return _cx_memb(_push_back)(self, value); } STC_INLINE void _cx_memb(_pop_front)(_cx_self* self) - { _cx_memb(_erase_after_)(self, self->last); } + { assert(!_cx_memb(_empty)(self)); _cx_memb(_erase_after_)(self, self->last); } STC_INLINE _cx_value* _cx_memb(_front)(const _cx_self* self) { return &self->last->next->value; } STC_INLINE _cx_value* _cx_memb(_back)(const _cx_self* self) { return &self->last->value; } |
