summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-05 10:49:06 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-05 10:51:11 -0500
commita51757076642700537944f970c9274ceb65cf77d (patch)
tree0b6eba75b526cfa54fd95e475f8e979030195e60
parent976cd7bfe58d2e18dad08fbe201cb8f4f78d4769 (diff)
downloadtext-handlebars-a51757076642700537944f970c9274ceb65cf77d.tar.gz
text-handlebars-a51757076642700537944f970c9274ceb65cf77d.zip
simplify
-rw-r--r--lib/Text/Handlebars.pm8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/Text/Handlebars.pm b/lib/Text/Handlebars.pm
index b756c04..914081f 100644
--- a/lib/Text/Handlebars.pm
+++ b/lib/Text/Handlebars.pm
@@ -72,13 +72,7 @@ sub options {
},
each => sub {
my ($context, $list, $options) = @_;
-
- my $ret = '';
- for my $new_context (@$list) {
- $ret .= $options->{fn}->($new_context);
- }
-
- return $ret;
+ return join '', map { $options->{fn}->($_) } @$list;
},
if => sub {
my ($context, $conditional, $options) = @_;