summaryrefslogtreecommitdiff
path: root/lib/Benchmark.pm
diff options
context:
space:
mode:
authorStas Bekman <stas@stason.org>2003-11-04 16:50:25 -0800
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-11-05 20:38:09 +0000
commitd598cef23bd608fe31ab6055c3ab087b1e23920e (patch)
treec1dcb97f049c0ebbb234f3cb11a60a8eb412c6d1 /lib/Benchmark.pm
parent57481f5a5779edbddd358964b7cfaa3d6f299dfc (diff)
downloadperl-d598cef23bd608fe31ab6055c3ab087b1e23920e.tar.gz
Re: [perl #24398] Benchmark.pm cmpthese segfault
Message-ID: <3FA8B9D1.2020806@stason.org> p4raw-id: //depot/perl@21671
Diffstat (limited to 'lib/Benchmark.pm')
-rw-r--r--lib/Benchmark.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm
index c472d58ffd..6129828f96 100644
--- a/lib/Benchmark.pm
+++ b/lib/Benchmark.pm
@@ -890,7 +890,7 @@ sub cmpthese{
@vals = sort { $a->[7] <=> $b->[7] } @vals;
# If more than half of the rates are greater than one...
- my $display_as_rate = $vals[$#vals>>1]->[7] > 1;
+ my $display_as_rate = @vals ? ($vals[$#vals>>1]->[7] > 1) : 0;
my @rows;
my @col_widths;