diff options
| author | Tyge Løvset <[email protected]> | 2020-12-03 13:38:22 +0100 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-12-03 13:38:22 +0100 |
| commit | 1e9cb938300022c83e3ca51dfc30ff636c068a02 (patch) | |
| tree | de804c900422695779eb35b007bd139bc74fd9e6 | |
| parent | 2d1934a09d42ef7245bed11abe8a330b6c0bf63d (diff) | |
| download | STC-modified-1e9cb938300022c83e3ca51dfc30ff636c068a02.tar.gz STC-modified-1e9cb938300022c83e3ca51dfc30ff636c068a02.zip | |
Fixed inconsistent API in cpqueue.
| -rw-r--r-- | docs/cpqueue_api.md | 2 | ||||
| -rw-r--r-- | stc/cpqueue.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/docs/cpqueue_api.md b/docs/cpqueue_api.md index 5e033c84..8ae2ed83 100644 --- a/docs/cpqueue_api.md +++ b/docs/cpqueue_api.md @@ -47,7 +47,7 @@ void cpqueue_X_push_n(cpqueue_X *self, const cpqueue_X_input_ void cpqueue_X_emplace(cpqueue_X* self, cpqueue_X_rawvalue_t raw); void cpqueue_X_push(cpqueue_X* self, cpqueue_X_value_t value); void cpqueue_X_pop(cpqueue_X* self); -void cpqueue_X_erase(cpqueue_X* self, size_t i); +void cpqueue_X_erase_at(cpqueue_X* self, size_t i); cpqueue_X_iter_t cpqueue_X_begin(cpqueue_X* self); cpqueue_X_iter_t cpqueue_X_end(cpqueue_X* self); diff --git a/stc/cpqueue.h b/stc/cpqueue.h index 130cac03..e753b5cd 100644 --- a/stc/cpqueue.h +++ b/stc/cpqueue.h @@ -66,11 +66,11 @@ STC_API void \
cpqueue_##X##_make_heap(cpqueue_##X* self); \
STC_API void \
- cpqueue_##X##_erase(cpqueue_##X* self, size_t i); \
+ cpqueue_##X##_erase_at(cpqueue_##X* self, size_t i); \
STC_INLINE const cpqueue_##X##_value_t* \
cpqueue_##X##_top(const cpqueue_##X* self) {return &self->data[0];} \
STC_INLINE void \
- cpqueue_##X##_pop(cpqueue_##X* self) {cpqueue_##X##_erase(self, 0);} \
+ cpqueue_##X##_pop(cpqueue_##X* self) {cpqueue_##X##_erase_at(self, 0);} \
STC_API void \
cpqueue_##X##_push(cpqueue_##X* self, cpqueue_##X##_value_t value); \
STC_INLINE void \
@@ -109,7 +109,7 @@ } \
\
STC_API void \
- cpqueue_##X##_erase(cpqueue_##X* self, size_t i) { \
+ cpqueue_##X##_erase_at(cpqueue_##X* self, size_t i) { \
size_t n = cpqueue_##X##_size(*self) - 1; \
self->data[i] = self->data[n]; \
ctype##_pop_back(self); \
|
