summaryrefslogtreecommitdiffstatshomepage
path: root/py/vstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'py/vstr.c')
-rw-r--r--py/vstr.c20
1 files changed, 0 insertions, 20 deletions
diff --git a/py/vstr.c b/py/vstr.c
index 1f9f13637b..6856cfe397 100644
--- a/py/vstr.c
+++ b/py/vstr.c
@@ -136,26 +136,6 @@ char *vstr_extend(vstr_t *vstr, size_t size) {
return p;
}
-// Shrink vstr to be given size
-bool vstr_set_size(vstr_t *vstr, size_t size) {
- if (vstr->fixed_buf) {
- return false;
- }
- char *new_buf = m_renew(char, vstr->buf, vstr->alloc, size);
- if (new_buf == NULL) {
- vstr->had_error = true;
- return false;
- }
- vstr->buf = new_buf;
- vstr->alloc = vstr->len = size;
- return true;
-}
-
-// Shrink vstr allocation to its actual length
-bool vstr_shrink(vstr_t *vstr) {
- return vstr_set_size(vstr, vstr->len);
-}
-
STATIC bool vstr_ensure_extra(vstr_t *vstr, size_t size) {
if (vstr->len + size + 1 > vstr->alloc) {
if (vstr->fixed_buf) {