From 1363cbd099d4724e4aef1fe278b71abc057d23cc Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Fri, 5 Nov 2010 23:51:06 -0700 Subject: Avoid a run-time miniperl check every time SWASHNEW is called --- lib/utf8_heavy.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 56cfe059c2..7951bc8565 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -100,13 +100,19 @@ sub croak { require Carp; Carp::croak(@_) } # keep going, but return an empty table so only what the code # has compiled in internally (currently ASCII/Latin1 range # matching) will work. - if (! defined &DynaLoader::boot_DynaLoader) { + BEGIN { + # Poor man's constant, to avoid a run-time check. + $utf8::{miniperl} + = \! defined &DynaLoader::boot_DynaLoader; + } + if (miniperl) { eval "require '$unicore_dir/Heavy.pl'"; last GETFILE if $@; } else { require "$unicore_dir/Heavy.pl"; } + BEGIN { delete $utf8::{miniperl} } # Everything is caseless matching my $property_and_table = lc $type; -- cgit v1.2.1