mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
avoid vm.new_stringref in pystr.rs
This commit is contained in:
@@ -337,8 +337,7 @@ impl PyStr {
|
||||
// This only works for `str` itself, not its subclasses.
|
||||
return zelf;
|
||||
}
|
||||
vm.ctx
|
||||
.new_stringref(zelf.value.repeat(value.to_usize().unwrap_or(0)))
|
||||
Self::from(zelf.value.repeat(value.to_usize().unwrap_or(0))).into_ref(vm)
|
||||
}
|
||||
|
||||
#[pymethod(magic)]
|
||||
|
||||
Reference in New Issue
Block a user