[Rt-commit] rt branch, 4.2/remove-get-name-by-ref-again, created. rt-4.1.5-8-ge291e40

Thomas Sibley trs at bestpractical.com
Thu Dec 6 17:40:13 EST 2012


The branch, 4.2/remove-get-name-by-ref-again has been created
        at  e291e4062cae804ea8d515b8315a62a5741dcb5f (commit)

- Log -----------------------------------------------------------------
commit e291e4062cae804ea8d515b8315a62a5741dcb5f
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Dec 6 14:30:38 2012 -0800

    Remove __GetNameByRef again, which was mistakenly re-added during a merge
    
    Specifically merge 9158080 which brought 4.0-trunk into master.

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 723d753..3f52d10 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1194,73 +1194,6 @@ sub SetFromConfig {
     return 1;
 }
 
-    our %REF_SYMBOLS = (
-            SCALAR => '$',
-            ARRAY  => '@',
-            HASH   => '%',
-            CODE   => '&',
-        );
-
-{
-    my $last_pack = '';
-
-    sub __GetNameByRef {
-        my $self = shift;
-        my $ref  = shift;
-        my $pack = shift;
-        if ( !$pack && $last_pack ) {
-            my $tmp = $self->__GetNameByRef( $ref, $last_pack );
-            return $tmp if $tmp;
-        }
-        $pack ||= 'main::';
-        $pack .= '::' unless substr( $pack, -2 ) eq '::';
-
-        no strict 'refs';
-        my $name = undef;
-
-        # scan $pack's nametable(hash)
-        foreach my $k ( keys %{$pack} ) {
-
-            # The hash for main:: has a reference to itself
-            next if $k eq 'main::';
-
-            # if the entry has a trailing '::' then
-            # it is a link to another name space
-            if ( substr( $k, -2 ) eq '::') {
-                $name = $self->__GetNameByRef( $ref, $k );
-                return $name if $name;
-            }
-
-            # entry of the table with references to
-            # SCALAR, ARRAY... and other types with
-            # the same name
-            my $entry = ${$pack}{$k};
-            next unless $entry;
-
-            # get entry for type we are looking for
-            # XXX skip references to scalars or other references.
-            # Otherwie 5.10 goes boom. maybe we should skip any
-            # reference
-            next if ref($entry) eq 'SCALAR' || ref($entry) eq 'REF';
-
-            my $ref_type = ref($ref);
-
-            # regex/arrayref/hashref/coderef are stored in SCALAR glob
-            $ref_type = 'SCALAR' if $ref_type eq 'REF';
-
-            my $entry_ref = *{$entry}{ $ref_type };
-            next unless $entry_ref;
-
-            # if references are equal then we've found
-            if ( $entry_ref == $ref ) {
-                $last_pack = $pack;
-                return ( $REF_SYMBOLS{ $ref_type } || '*' ) . $pack . $k;
-            }
-        }
-        return '';
-    }
-}
-
 =head2 Metadata
 
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list