diff options
Diffstat (limited to 'lib/Text')
-rw-r--r-- | lib/Text/Handlebars.pm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm index cf2a8f1..b756c04 100644 --- a/lib/Text/Handlebars.pm +++ b/lib/Text/Handlebars.pm @@ -82,17 +82,15 @@ sub options { }, if => sub { my ($context, $conditional, $options) = @_; - if ($conditional) { - return $options->{fn}->($context); - } - return $options->{inverse} ? $options->{inverse}->($context) : ''; + return $conditional + ? $options->{fn}->($context) + : $options->{inverse}->($context); }, unless => sub { my ($context, $conditional, $options) = @_; - unless ($conditional) { - return $options->{fn}->($context); - } - return $options->{inverse} ? $options->{inverse}->($context) : ''; + return $conditional + ? $options->{inverse}->($context) + : $options->{fn}->($context); }, }, |