From 717ab7e7ccc4731ec6f4128a9e6e87883e7d4410 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 26 Feb 2019 17:01:41 -0300 Subject: [PATCH] Bug 21846: Simplify ugly double for loops --- t/db_dependent/Tags.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Tags.t b/t/db_dependent/Tags.t index 0952e9a4f7..93014bb3c1 100755 --- a/t/db_dependent/Tags.t +++ b/t/db_dependent/Tags.t @@ -89,8 +89,8 @@ subtest 'add_tag_index() tests' => sub { '👍' => 1, }; - for my $term ( keys %{ $terms } ) { - for (my $i=1; $i <= $terms->{$term}; $i++) { + while ( my ( $term, $count ) = each %$terms ) { + for ( 1 .. $count ) { C4::Tags::add_tag_approval( $term ); C4::Tags::add_tag_index( $term, $biblio->biblionumber ); } -- 2.11.0