diff options
author | Jesse Luehrs <doy@tozt.net> | 2012-10-05 10:47:38 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2012-10-05 10:51:07 -0500 |
commit | 976cd7bfe58d2e18dad08fbe201cb8f4f78d4769 (patch) | |
tree | 84af86221067b5aa402c8ae18d97018acb0d4df1 /lib/Text/Handlebars.pm | |
parent | 1a010552eeb2a965c92fab007c45f8e59ac60b02 (diff) | |
download | text-handlebars-976cd7bfe58d2e18dad08fbe201cb8f4f78d4769.tar.gz text-handlebars-976cd7bfe58d2e18dad08fbe201cb8f4f78d4769.zip |
simplify
Diffstat (limited to 'lib/Text/Handlebars.pm')
-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); }, }, |