From 569a68309cd5867d680bf11c4ab165a3b77509a1 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Wed, 3 Jan 2024 15:41:15 -0600 Subject: [PATCH] Minor code cleanup --- HexGrid/Image.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/HexGrid/Image.pm b/HexGrid/Image.pm index b94b6e4..6f0dddd 100644 --- a/HexGrid/Image.pm +++ b/HexGrid/Image.pm @@ -29,12 +29,11 @@ sub render($this, $container) my $href = $this->{source}; if ($this->{fetch}) { - $this->_fetch_base64 unless defined($this->{_cached_data}); - $href = $this->{_cached_data}; + $href = $this->{_cached_data} // $this->_fetch_base64; } $image_element->{href} = $href; - $image_element->{width} = $this->{width} if defined($this->{width}); - $image_element->{height} = $this->{height} if defined($this->{height}); + $image_element->{width} = $this->{width}; + $image_element->{height} = $this->{height}; return $image_element; }