From 2922b1a9432c3b8bc0c249ff2ee892118df2b374 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Tue, 26 Nov 2013 14:33:49 -0800 Subject: [PATCH] tzinfo: simplify magic check. --- extra/tzinfo/tzinfo.factor | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/extra/tzinfo/tzinfo.factor b/extra/tzinfo/tzinfo.factor index c1f0d25eae..998353eab4 100644 --- a/extra/tzinfo/tzinfo.factor +++ b/extra/tzinfo/tzinfo.factor @@ -11,7 +11,6 @@ IN: tzinfo > "TZif" sequence= [ bad-magic ] unless ; +: check-magic ( -- ) + 4 read "TZif" sequence= [ bad-magic ] unless ; TUPLE: tzfile header transition-times local-times types abbrevs leaps is-std is-gmt ; @@ -39,7 +38,7 @@ C: tzfile 4 read be32 deref ; : read-tzfile ( -- tzfile ) - tzhead read-struct check-magic dup { + check-magic tzhead read-struct dup { [ tzh_timecnt>> [ read-be32 ] replicate ] [ tzh_timecnt>> [ read1 ] replicate ] [ tzh_typecnt>> [ ttinfo read-struct ] replicate ]