Skip to content

Commit 30b6648

Browse files
committed
Small refactoring: should use RSTR_CAPA
1 parent 07167b8 commit 30b6648

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/string.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ str_buf_cat(mrb_state *mrb, struct RString *s, const char *ptr, size_t len)
154154
off = ptr - RSTR_PTR(s);
155155
}
156156

157-
if (RSTR_EMBED_P(s))
158-
capa = RSTRING_EMBED_LEN_MAX;
159-
else
160-
capa = s->as.heap.aux.capa;
157+
capa = RSTR_CAPA(s);
161158
if (capa <= RSTRING_EMBED_LEN_MAX)
162159
capa = RSTRING_EMBED_LEN_MAX+1;
163160

0 commit comments

Comments
 (0)