Skip to content

Commit fca4178

Browse files
committed
Avoid unnecessary allocation in modulo formatting
1 parent 5d38b9b commit fca4178

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/obj/objstr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,11 +1269,11 @@ fn do_cformat(
12691269

12701270
// check that all arguments were converted
12711271
if !mapping_required {
1272-
if !objtuple::get_value(&values_obj)
1272+
if objtuple::get_value(&values_obj)
12731273
.into_iter()
12741274
.skip(auto_index)
1275-
.collect::<Vec<PyObjectRef>>()
1276-
.is_empty()
1275+
.next()
1276+
.is_some()
12771277
{
12781278
return Err(vm.new_type_error(
12791279
"not all arguments converted during string formatting".to_string(),

0 commit comments

Comments
 (0)