We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b26b86c commit a0305dbCopy full SHA for a0305db
starlark/src/values/layout/heap.rs
@@ -311,6 +311,11 @@ impl Heap {
311
}
312
313
pub(crate) fn alloc_str_concat<'v>(&'v self, x: &str, y: &str) -> Value<'v> {
314
+ // If either strings is empty, we should not be calling this function
315
+ // but reuse non-empty string object instead.
316
+ debug_assert!(!x.is_empty());
317
+ debug_assert!(!y.is_empty());
318
+
319
self.alloc_str_init(x.len() + y.len(), |dest| unsafe {
320
copy_nonoverlapping(x.as_ptr(), dest, x.len());
321
copy_nonoverlapping(y.as_ptr(), dest.add(x.len()), y.len())
0 commit comments