summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2021-10-06 16:08:08 +0200
committerTyge Løvset <[email protected]>2021-10-06 16:08:08 +0200
commit435fd25e5c74aea72eb20f4007977183cdbe0919 (patch)
tree58606c15052b37d27858ea6f707df8b2edf34a49 /include/stc/cvec.h
parent0fa5220d8d7cddbb668d02045ebd36709ba0bc6f (diff)
downloadSTC-modified-435fd25e5c74aea72eb20f4007977183cdbe0919.tar.gz
STC-modified-435fd25e5c74aea72eb20f4007977183cdbe0919.zip
Some while to for changed. Return value for cstack_X_push/emplace. Docs updated.
Diffstat (limited to 'include/stc/cvec.h')
-rw-r--r--include/stc/cvec.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 745411fc..c6dcb147 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -309,7 +309,7 @@ cx_memb(_insert_range_p)(Self* self, cx_value_t* pos,
const cx_value_t* p1, const cx_value_t* p2, bool clone) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- if (clone) while (p1 != p2) { *pos++ = i_valfrom(i_valto(p1)); ++p1; }
+ if (clone) for (; p1 != p2; ++p1) *pos++ = i_valfrom(i_valto(p1));
else memcpy(pos, p1, (p2 - p1)*sizeof *p1);
return it;
}
@@ -319,7 +319,7 @@ cx_memb(_emplace_range_p)(Self* self, cx_value_t* pos, const cx_rawvalue_t* p1,
const cx_rawvalue_t* p2) {
pos = cx_memb(_insert_space_)(self, pos, p2 - p1);
cx_iter_t it = {pos};
- while (p1 != p2) { *pos++ = i_valfrom(*p1); ++p1; }
+ for (; p1 != p2; ++p1) *pos++ = i_valfrom(*p1);
return it;
}
@@ -328,7 +328,7 @@ cx_memb(_erase_range_p)(Self* self, cx_value_t* p1, cx_value_t* p2) {
intptr_t len = p2 - p1;
if (len > 0) {
cx_value_t* p = p1, *end = self->data + cvec_rep_(self)->size;
- while (p != p2) { i_valdel(p); ++p; }
+ for (; p != p2; ++p) i_valdel(p);
memmove(p1, p2, (end - p2) * sizeof(i_val));
cvec_rep_(self)->size -= len;
}