From 5b07c1553657ee0f7c06ade0ac3ca20d97b7ae11 Mon Sep 17 00:00:00 2001 From: Mark Glines Date: Fri, 20 Jun 2008 14:28:09 -0700 Subject: [PATCH] Use an alternate default-or syntax, which brings 2D::Sparse coverage to 100%. --- lib/Language/Befunge/Storage/2D/Sparse.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Language/Befunge/Storage/2D/Sparse.pm b/lib/Language/Befunge/Storage/2D/Sparse.pm index 70c6977..b68a0da 100644 --- a/lib/Language/Befunge/Storage/2D/Sparse.pm +++ b/lib/Language/Befunge/Storage/2D/Sparse.pm @@ -77,7 +77,8 @@ sub clear { sub store_binary { my ($self, $code, $position) = @_; - my $offset = $position || LBV->new(0,0); + my $offset = $position; + $offset = LBV->new(0,0) unless defined $offset; my $x = $offset->get_component(0); my $y = $offset->get_component(1); my $href = $self->_storage; @@ -116,7 +117,8 @@ sub store_binary { sub store { my ($self, $code, $position) = @_; - my $offset = $position || LBV->new(0,0); + my $offset = $position; + $offset = LBV->new(0,0) unless defined $offset; my $dy = LBV->new(0,1); # support for any eol convention -- 2.11.4.GIT