From 4f006a5cadcb0b4e8f26fedf868f634da8a5cbec Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Wed, 8 Nov 2017 17:11:57 +0100 Subject: [PATCH] TT#24097 Use block form for map and grep Change-Id: I6e2c68762c13bb89dcaf916f8e5ce476c34179dd --- tests/3-way-connect-simulator | 14 +++++++------- tests/reinvite-simulator | 8 ++++---- tests/simulator-ng.pl | 2 +- tests/simulator-udp.pl | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/3-way-connect-simulator b/tests/3-way-connect-simulator index ae4e8f663..f48796372 100755 --- a/tests/3-way-connect-simulator +++ b/tests/3-way-connect-simulator @@ -51,7 +51,7 @@ sub udp_sock { sub send_rcv { my ($sendfd, $sendtoip, $sendtoport, $recvfd) = @_; print("sending to $sendtoip:$sendtoport... "); - my $pkt = join('',map(rand,1..10)); + my $pkt = join('', map { rand } 1..10); send($sendfd, $pkt, 0, sockaddr_in($sendtoport, inet_aton($sendtoip))) or die; my $inc; { @@ -97,12 +97,12 @@ sub sim_lk { -my $callid1 = join('',map(rand,1..2)); -my $fromtag1 = join('',map(rand,1..4)); -my $totag1 = join('',map(rand,1..4)); -my $callid2 = join('',map(rand,1..2)); -my $fromtag2 = join('',map(rand,1..4)); -my $totag2 = join('',map(rand,1..4)); +my $callid1 = join('', map { rand } 1..2); +my $fromtag1 = join('', map { rand } 1..4); +my $totag1 = join('', map { rand } 1..4); +my $callid2 = join('', map { rand } 1..2); +my $fromtag2 = join('', map { rand } 1..4); +my $totag2 = join('', map { rand } 1..4); my ($client1, $lp1) = udp_sock(); my ($client2, $lp2) = udp_sock(); diff --git a/tests/reinvite-simulator b/tests/reinvite-simulator index 708baa5aa..ac31a0578 100755 --- a/tests/reinvite-simulator +++ b/tests/reinvite-simulator @@ -53,7 +53,7 @@ sub send_rcv { my $laddr = getsockname($sendfd); my ($lport, $lip) = sockaddr_in($laddr); print("local port $lport sending to $sendtoip:$sendtoport... "); - my $pkt = join('',map(rand,1..10)); + my $pkt = join('', map { rand } 1..10); send($sendfd, $pkt, 0, sockaddr_in($sendtoport, inet_aton($sendtoip))) or die; my ($inc, $addr); { @@ -108,9 +108,9 @@ sub sim_lk { -my $callid = join('',map(rand,1..2)); -my $fromtag = join('',map(rand,1..4)); -my $totag = join('',map(rand,1..4)); +my $callid = join('', map { rand } 1..2); +my $fromtag = join('', map { rand } 1..4); +my $totag = join('', map { rand } 1..4); my ($client1, $lp1) = udp_sock(); my ($client2, $lp2) = udp_sock(); diff --git a/tests/simulator-ng.pl b/tests/simulator-ng.pl index 339bce7fd..244193173 100755 --- a/tests/simulator-ng.pl +++ b/tests/simulator-ng.pl @@ -792,7 +792,7 @@ while (time() < $end) { do_rtp($rtcp); - @calls = sort {rand() < .5} grep(defined, @calls); + @calls = sort { rand() < .5 } grep { defined } @calls; if ($REINVITES && $now >= $last_reinv + 15) { $last_reinv = $now; diff --git a/tests/simulator-udp.pl b/tests/simulator-udp.pl index 9556832b1..035cbd1f6 100755 --- a/tests/simulator-udp.pl +++ b/tests/simulator-udp.pl @@ -175,7 +175,7 @@ while (time() < $end) { sleep(1); do_rtp(); - @calls = sort {rand() < .5} grep(defined, @calls); + @calls = sort { rand() < .5 } grep { defined } @calls; if ($REINVITES) { my $c = $calls[rand(@calls)];