In #254 we began inlining CompactStrings when Clone-ing, if the capacity of the CompactString was less than MAX_SIZE. This made sure we retained any additional capacity a user may have allocated.
During some experimentation though, I realized String truncates capacity during clone, example.
As such this PR updates the eager inlining during Clone to instead be based on the source CompactString's length, which. This allows us to more frequently inline strings, and follows the same behavior as String.
In #254 we began inlining
CompactString
s whenClone
-ing, if the capacity of theCompactString
was less thanMAX_SIZE
. This made sure we retained any additional capacity a user may have allocated.During some experimentation though, I realized
String
truncates capacity during clone, example.As such this PR updates the eager inlining during
Clone
to instead be based on the sourceCompactString
's length, which. This allows us to more frequently inline strings, and follows the same behavior asString
.