summaryrefslogtreecommitdiffhomepage
path: root/include/stc/priv/cqueue_hdr.h
diff options
context:
space:
mode:
authortylov <[email protected]>2023-08-13 14:14:25 +0200
committertylov <[email protected]>2023-08-13 14:14:25 +0200
commit1802558d41112e99d965000c97c45ebf7984d70c (patch)
tree2cc9d1dd337ad8783de7b8ac579cf144f2f54031 /include/stc/priv/cqueue_hdr.h
parentea878349e94ef00643b2510045f6482385cff1a7 (diff)
downloadSTC-modified-1802558d41112e99d965000c97c45ebf7984d70c.tar.gz
STC-modified-1802558d41112e99d965000c97c45ebf7984d70c.zip
Fixed cqueue.h: cqueue_X_copy() was not defined inside a `c_no_clone` check.
Reverted to 2X expansion for cvec to compete with gcc speed.
Diffstat (limited to 'include/stc/priv/cqueue_hdr.h')
-rw-r--r--include/stc/priv/cqueue_hdr.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/stc/priv/cqueue_hdr.h b/include/stc/priv/cqueue_hdr.h
index 1cad8684..06f3bd74 100644
--- a/include/stc/priv/cqueue_hdr.h
+++ b/include/stc/priv/cqueue_hdr.h
@@ -59,6 +59,11 @@ STC_API bool _cx_MEMB(_eq)(const _cx_Self* self, const _cx_Self* othe
STC_API _cx_Self _cx_MEMB(_clone)(_cx_Self cx);
STC_INLINE i_key _cx_MEMB(_value_clone)(i_key val)
{ return i_keyclone(val); }
+STC_INLINE void _cx_MEMB(_copy)(_cx_Self* self, const _cx_Self* other) {
+ if (self->data == other->data) return;
+ _cx_MEMB(_drop)(self);
+ *self = _cx_MEMB(_clone)(*other);
+ }
#endif // !i_no_clone
STC_INLINE intptr_t _cx_MEMB(_size)(const _cx_Self* self)
{ return _cdeq_toidx(self, self->end); }
@@ -88,12 +93,6 @@ STC_INLINE _cx_value _cx_MEMB(_pull)(_cx_Self* self) { // move front out of queu
return self->data[s];
}
-STC_INLINE void _cx_MEMB(_copy)(_cx_Self* self, const _cx_Self* other) {
- if (self->data == other->data) return;
- _cx_MEMB(_drop)(self);
- *self = _cx_MEMB(_clone)(*other);
-}
-
STC_INLINE _cx_iter _cx_MEMB(_begin)(const _cx_Self* self) {
return c_LITERAL(_cx_iter){
.ref=_cx_MEMB(_empty)(self) ? NULL : self->data + self->start,