Minor optimization to list.h and added finished more TODOs from sortedlist.h
This commit is contained in:
1 parent
34e649d82a
commit
376c0ad4e7
2 files changed
+526
-539
No files matched your search
@@ -327,21 +327,9 @@ static const char *cmc_string_fmt_list = "%s at %p { buffer:%p, capacity:%" PRIu
|
||||
\
|
||||
bool PFX##_pop_at(SNAME *_list_, size_t index) \
|
||||
{ \
|
||||
if (PFX##_empty(_list_)) \
|
||||
return false; \
|
||||
\
|
||||
if (index >= _list_->count) \
|
||||
return false; \
|
||||
\
|
||||
if (index == 0) \
|
||||
{ \
|
||||
return PFX##_pop_front(_list_); \
|
||||
} \
|
||||
else if (index == _list_->count - 1) \
|
||||
{ \
|
||||
return PFX##_pop_back(_list_); \
|
||||
} \
|
||||
\
|
||||
memmove(_list_->buffer + index, _list_->buffer + index + 1, (_list_->count - index) * sizeof(V)); \
|
||||
\
|
||||
_list_->buffer[--_list_->count] = PFX##_impl_default_value(); \
|
||||
|
||||
+526
-527
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user