[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Aug 30 16:54:13 UTC 2005


mwilkinson
Tue Aug 30 12:54:12 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv23402/MOBY/Client

Modified Files:
	Central.pm 
Log Message:
doh.  The cache was caching references to lists that were then being shifted and emptied, so the cache ended up empty

moby-live/Perl/MOBY/Client Central.pm,1.118,1.119
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -r1.118 -r1.119
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2005/08/30 16:36:17	1.118
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2005/08/30 16:54:12	1.119
@@ -1969,11 +1969,12 @@
 		my @isalsids;
 		foreach (@$isas){
 		    my $lsid = $self->ObjLSID($_);
-		    push @isalsids, $lsid if $lsid;
+		    next unless ($lsid =~ /^urn\:lsid/);
+		    push @isalsids, $lsid;
 		}
-		$self->{ISA_CACHE}->{$desiredterm} = \@isalsids;
-		while ( my $term = shift(@isalsids) ) {
-			$self->{ISA_CACHE}->{$term} = \@isalsids;
+		$self->{ISA_CACHE}->{$desiredterm} = [@$isalsids];  # can't assign a listreference or it will empty itself!
+		while ( my $term = shift(@isalsids) ) {  # traverse down and flatten the list
+			$self->{ISA_CACHE}->{$term} = [@$isalsids];
 		}
 		return @{ $self->{ISA_CACHE}->{$desiredterm} };
 	}




More information about the MOBY-guts mailing list