summaryrefslogtreecommitdiff
path: root/regcomp.c
diff options
context:
space:
mode:
authorMatt Valentine-House <[email protected]>2023-06-08 21:12:14 +0100
committerMatt Valentine-House <[email protected]>2023-06-09 10:54:40 +0100
commitd54f66d1b4ce32d78b526b1ea9e3f213a763d07c ()
tree14703670ec6c626fc6320f035d4d1e05cc0759a0 /regcomp.c
parent72f07f0a5f882e87e305d668587152fa209a0568 (diff)
Assign into optimal size pools using String#split("")
When String#split is used with an empty string as the field seperator it effectively splits the original string into chars, and there is a pre-existing fast path for this using SPLIT_TYPE_CHARS. However this path creates an empty array in the smallest size pool and grows from there, despite already knowing the size of the desired array. This commit pre-allocates the correct size array in this case in order to allow the arrays to be embedded and avoid being allocated in the transient heap
Notes: Merged: https://.com/ruby/ruby/pull/7919
0 files changed, 0 insertions, 0 deletions