summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <public@khwilliamson.com>2011-07-09 18:09:44 -0600
committerKarl Williamson <public@khwilliamson.com>2011-07-10 15:35:01 -0600
commit4b9b0bc599bf6e6d08beb6537faebe95a32ba514 (patch)
treea02ce8ec5dba659009593fe8b3194e0efa997d3e
parent688cbe000ebdb2f740226b5e0a000d12cc474aa6 (diff)
downloadperl-4b9b0bc599bf6e6d08beb6537faebe95a32ba514.tar.gz
mktables: New method on properties to delete tables
This method will be used in a future commit.
-rw-r--r--lib/unicore/mktables19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/unicore/mktables b/lib/unicore/mktables
index 46cef3ed90..47c390ab0e 100644
--- a/lib/unicore/mktables
+++ b/lib/unicore/mktables
@@ -7430,6 +7430,25 @@ sub trace { return main::trace(@_) if main::DEBUG && $to_trace }
return $table;
}
+ sub delete_match_table {
+ # Delete the table referred to by $2 from the property $1.
+
+ my $self = shift;
+ my $table_to_remove = shift;
+ Carp::carp_extra_args(\@_) if main::DEBUG && @_;
+
+ my $addr = do { no overloading; pack 'J', $self; };
+
+ # Remove all names that refer to it.
+ foreach my $key (keys %{$table_ref{$addr}}) {
+ delete $table_ref{$addr}{$key}
+ if $table_ref{$addr}{$key} == $table_to_remove;
+ }
+
+ $table_to_remove->DESTROY;
+ return;
+ }
+
sub table {
# Return a pointer to the match table (with name given by the
# parameter) associated with this property; undef if none.