This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
mktables: Convert value_of() to use containing_range()
authorKarl Williamson <public@khwilliamson.com>
Sat, 9 Oct 2010 23:42:48 +0000 (17:42 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 12 Oct 2010 20:47:36 +0000 (13:47 -0700)
lib/unicore/mktables

index e58b996..de3bd0d 100644 (file)
@@ -2869,12 +2869,10 @@ sub trace { return main::trace(@_); }
         my $codepoint = shift;
         Carp::carp_extra_args(\@_) if main::DEBUG && @_;
 
-        my $i = $self->contains($codepoint);
-        return unless $i;
+        my $range = $self->containing_range($codepoint);
+        return unless defined $range;
 
-        # contains() returns 1 beyond where we should look
-        no overloading;
-        return $ranges{pack 'J', $self}->[$i-1]->value;
+        return $range->value;
     }
 
     sub _search_ranges {