From e8cd9a19782fbc1d6c83565e967c73dfda165338 Mon Sep 17 00:00:00 2001 From: Uriel Date: Mon, 1 Jun 2009 07:00:11 +0200 Subject: [PATCH] Optimization: avoid using a temporary file to calculate the hash in md_handler. --- bin/corehandlers.rc | 2 +- bin/fltr_cache.rc | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/corehandlers.rc b/bin/corehandlers.rc index e72b20f..4deeaec 100644 --- a/bin/corehandlers.rc +++ b/bin/corehandlers.rc @@ -47,7 +47,7 @@ fn link_bar { echo '' } -fn md_handler { $formatter < $1 } +fn md_handler { $formatter $1 } fn tpl_handler { template $* } diff --git a/bin/fltr_cache.rc b/bin/fltr_cache.rc index f09c963..67e82bd 100755 --- a/bin/fltr_cache.rc +++ b/bin/fltr_cache.rc @@ -19,8 +19,10 @@ fn fltr_cache { a=$f f=/dev/null } - if not + if not { score=`{sha1sum $f || exit 1} + score=$score(1) + } } cachedir=/tmp/fltr_cache/$score mkdir -p $cachedir >[2]/dev/null