From 201664ed4f9cd6aa736a4ca34ac77396f292d4fb Mon Sep 17 00:00:00 2001 From: Jeong YunWon Date: Thu, 12 Aug 2021 20:58:38 +0900 Subject: [PATCH] avoid vm.new_stringref in pystr.rs --- vm/src/builtins/pystr.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vm/src/builtins/pystr.rs b/vm/src/builtins/pystr.rs index c5ed52d7c..39dede033 100644 --- a/vm/src/builtins/pystr.rs +++ b/vm/src/builtins/pystr.rs @@ -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)]