From 9e98814213ab90ed9b6cfc3b064a39ba99ac0c05 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Wed, 21 Nov 2007 14:40:07 +0100 Subject: [PATCH] Compacted is_topic_editor and is_visible_story. --- Gruta/Template/Artemus.pm | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Gruta/Template/Artemus.pm b/Gruta/Template/Artemus.pm index f9c2ec4..a4e0014 100644 --- a/Gruta/Template/Artemus.pm +++ b/Gruta/Template/Artemus.pm @@ -248,11 +248,7 @@ sub _artemus { }; $f{is_topic_editor} = sub { - my $topic; - -# return ($topic = $data->topic($_[0]) && -# $topic->is_editor($data->auth())) ? 1 : 0; - if ($topic = $data->topic($_[0])) { + if (my $topic = $data->topic($_[0])) { return $topic->is_editor($data->auth()) ? 1 : 0; } @@ -335,9 +331,7 @@ sub _artemus { }; $f{is_visible_story} = sub { - my $story; - - if ($story = $data->story($_[0], $_[1])) { + if (my $story = $data->story($_[0], $_[1])) { return $story->is_visible($data->auth()) ? 1 : 0; } -- 2.11.4.GIT