diff options
| author | ksss <[email protected]> | 2017-01-02 16:33:58 +0900 |
|---|---|---|
| committer | ksss <[email protected]> | 2017-01-02 16:33:58 +0900 |
| commit | 30b6648b9c53f8c3f5156910758cb37eb0d654a7 (patch) | |
| tree | a8b974d18a3f4528be6424a744b5e03e00d4f597 /src | |
| parent | 07167b8f5eb7e0ff7b4048ffcfefe9a38c904a75 (diff) | |
| download | mruby-30b6648b9c53f8c3f5156910758cb37eb0d654a7.tar.gz mruby-30b6648b9c53f8c3f5156910758cb37eb0d654a7.zip | |
Small refactoring: should use RSTR_CAPA
Diffstat (limited to 'src')
| -rw-r--r-- | src/string.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/string.c b/src/string.c index 072bf2226..b57f1cec4 100644 --- a/src/string.c +++ b/src/string.c @@ -154,10 +154,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len) off = ptr - RSTR_PTR(s); } - if (RSTR_EMBED_P(s)) - capa = RSTRING_EMBED_LEN_MAX; - else - capa = s->as.heap.aux.capa; + capa = RSTR_CAPA(s); if (capa <= RSTRING_EMBED_LEN_MAX) capa = RSTRING_EMBED_LEN_MAX+1; |
