diff options
author | Damien George <damien.p.george@gmail.com> | 2016-10-14 16:46:34 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2016-10-14 16:46:34 +1100 |
commit | 824f5c5a32d740acad50d23b7ab1d69660dcf3ad (patch) | |
tree | c2d1f13b656b7a2f218fa59e20fd2ca039d03721 /unix | |
parent | ed878275b020c006ec197bb5f5bdd8179fb36a4c (diff) | |
download | micropython-824f5c5a32d740acad50d23b7ab1d69660dcf3ad.tar.gz micropython-824f5c5a32d740acad50d23b7ab1d69660dcf3ad.zip |
py/vstr: Combine vstr_new_size with vstr_new since they are rarely used.
Now there is just one function to allocate a new vstr, namely vstr_new
(in addition to vstr_init etc). The caller of this function should know
what initial size to allocate for the buffer, or at least have some policy
or config option, instead of leaving it to a default (as it was before).
Diffstat (limited to 'unix')
-rw-r--r-- | unix/coverage.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unix/coverage.c b/unix/coverage.c index c84a653f75..6a1b43fdce 100644 --- a/unix/coverage.c +++ b/unix/coverage.c @@ -34,7 +34,7 @@ STATIC mp_obj_t extra_coverage(void) { // vstr { mp_printf(&mp_plat_print, "# vstr\n"); - vstr_t *vstr = vstr_new_size(16); + vstr_t *vstr = vstr_new(16); vstr_hint_size(vstr, 32); vstr_add_str(vstr, "ts"); vstr_ins_byte(vstr, 1, 'e'); |