소스 검색

slight perf improvement

George Baugh 3 년 전
부모
커밋
b13e1f0cae
1개의 변경된 파일5개의 추가작업 그리고 4개의 파일을 삭제
  1. 5 4
      lib/Trog/Routes/HTML.pm

+ 5 - 4
lib/Trog/Routes/HTML.pm

@@ -858,14 +858,15 @@ sub posts ($query, $render_cb, $direct=0) {
             },
         }
     );
+    my $child_renderer = sub {
+        my ($template_string, $options) = @_;
+        return $child_processor->render_string($template_string,$options);
+    };
 
     my $processor = Text::Xslate->new(
         path   => $template_dir,
         function => {
-            render_it => sub {
-                my ($template_string, $options) = @_;
-                return $child_processor->render_string($template_string,$options);
-            },
+            render_it => $child_renderer,
         },
     );