summaryrefslogtreecommitdiffhomepage
path: root/include/stc/cvec.h
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-11-21 22:43:23 +0100
committerTyge Løvset <[email protected]>2022-11-21 22:43:23 +0100
commit512cba08af831a864e09d34f02250820d3d76883 (patch)
tree5f150639ed06c64b752410e8fd5e558fce722a48 /include/stc/cvec.h
parentdcaf91987cfacd6a6ed66532e5a2a4200c46651b (diff)
downloadSTC-modified-512cba08af831a864e09d34f02250820d3d76883.tar.gz
STC-modified-512cba08af831a864e09d34f02250820d3d76883.zip
Changed internal representation of cdeq. All containers in STC can now be initialized with {NULL}.
Diffstat (limited to 'include/stc/cvec.h')
-rw-r--r--include/stc/cvec.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/include/stc/cvec.h b/include/stc/cvec.h
index 4bcba3cc..c8025343 100644
--- a/include/stc/cvec.h
+++ b/include/stc/cvec.h
@@ -308,7 +308,8 @@ _cx_memb(_push)(_cx_self* self, i_key value) {
if (!_cx_memb(_reserve)(self, self->_len*3/2 + 4))
return NULL;
_cx_value *v = self->data + self->_len++;
- *v = value; return v;
+ *v = value;
+ return v;
}
STC_DEF _cx_iter
@@ -388,7 +389,7 @@ _cx_memb(_find_in)(_cx_iter i1, _cx_iter i2, _cx_raw raw) {
if (i_eq((&raw), (&r)))
return i1;
}
- i2.ref = NULL; // NB!
+ i2.ref = NULL;
return i2;
}
@@ -406,7 +407,7 @@ _cx_memb(_binary_search_in)(_cx_iter i1, _cx_iter i2, const _cx_raw raw,
else if (c < 0) p2 = mid.ref;
else i1.ref = mid.ref + 1;
}
- i2.ref = NULL; // NB!
+ i2.ref = NULL;
*lower_bound = i1.ref == i2.end ? i2 : i1;
return i2;
}