From: beatles Date: Sat, 7 Mar 2009 10:55:20 +0000 (+0000) Subject: Improved performance. X-Git-Tag: 20170902~176 X-Git-Url: http://git.sourceforge.jp/view?p=shogi-server%2Fshogi-server.git;a=commitdiff_plain;h=6bf7469c725ebf9cb64021dbaa35557abe299b00 Improved performance. --- diff --git a/changelog b/changelog index c70e0bf..0fbeba5 100644 --- a/changelog +++ b/changelog @@ -1,3 +1,8 @@ +2009-03-07 Daigo Moriwaki + + * [csa-file-filter] + - Improved performance. + 2009-02-15 Daigo Moriwaki * [shogi-server] diff --git a/csa-file-filter b/csa-file-filter index 297edc0..681be6f 100755 --- a/csa-file-filter +++ b/csa-file-filter @@ -76,10 +76,8 @@ def filter(filename) return unless /(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})\.csa$/ =~ filename file_date = Date.new($1.to_i, $2.to_i, $3.to_i) - now = Time.now - now_date = Date.new(now.year, now.month, now.day) - return if now_date - file_date > $options["within"] + return if $now_date - file_date > $options["within"] end puts filename @@ -145,6 +143,8 @@ def main end if __FILE__ == $0 + now = Time.now + $now_date = Date.new(now.year, now.month, now.day) main end