From ec40ee88e0898838adba3e07cc8d62b7d0790802 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Sun, 21 Aug 2011 10:24:11 -0600 Subject: [PATCH] mktables: use master range list if inverse This patch subclasses the method that returns the range associated with a table to instead return its complement's range. This means that when working on a table that is a complement, you are really working on its complement. This will be used in a future commit to avoid populating the complement. The base class has to change so that the method can be subclassed. --- lib/unicore/mktables | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/unicore/mktables b/lib/unicore/mktables index 4d1512b..8821776 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -5370,8 +5370,7 @@ sub trace { return main::trace(@_); } *$sub = sub { use strict "refs"; my $self = shift; - no overloading; - return $range_list{pack 'J', $self}->$sub(@_); + return $self->_range_list->$sub(@_); } } @@ -5387,7 +5386,7 @@ sub trace { return main::trace(@_); } return if $self->carp_if_locked; no overloading; - return $range_list{pack 'J', $self}->$sub(@_); + return $self->_range_list->$sub(@_); } } @@ -6647,6 +6646,20 @@ sub trace { return main::trace(@_); } return "Table '$name'"; } + sub _range_list { + # Returns the range list associated with this table, which will be the + # complement's if it has one. + + my $self = shift; + my $complement; + if (($complement = $self->complement) != 0) { + return ~ $complement->_range_list; + } + else { + return $self->SUPER::_range_list; + } + } + sub add_alias { # Add a synonym for this table. See the comments in the base class -- 1.8.3.1