[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Dec 30 20:21:31 UTC 2003


mwilkinson
Tue Dec 30 15:21:31 EST 2003
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv16357/Perl/MOBY

Modified Files:
	CommonSubs.pm 
Log Message:
whichDeepestParentObject should return right away if it finds an object in the list you provided it.  Before this would actualy return Object if you gave it the exact object type as part of the search

moby-live/Perl/MOBY CommonSubs.pm,1.39,1.40
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/12/28 20:41:59	1.39
+++ /home/repository/moby/moby-live/Perl/MOBY/CommonSubs.pm	2003/12/30 20:21:30	1.40
@@ -1098,11 +1098,12 @@
     my ($CENTRAL, $queryTerm, $termlist) = @_;
     return (undef,undef) unless ($CENTRAL && $queryTerm && $termlist && (ref($termlist) =~ /ARRAY/));
     my %nodeLSIDs;
+    my $queryLSID = $CENTRAL->ObjLSID($queryTerm);
     foreach (@$termlist){ # get list of known LSIDs
         my $lsid = $CENTRAL->ObjLSID($_);
-        $nodeLSIDs{$lsid}=$_;
+        return ($_, $lsid) if ($lsid eq $queryLSID);  # of course, if we find it in the list, then return it right away!
+        $nodeLSIDs{$lsid}=$_;        
     }
-    my $queryLSID = $CENTRAL->ObjLSID($queryTerm);
     return (undef, undef) unless keys(%nodeLSIDs);
     my $isa = $CENTRAL->ISA($queryTerm, 'Object'); # set the complete parentage in the cache if it isn't already
     return (undef, undef) unless $isa; # this should return true or we are in BIIIG trouble!




More information about the MOBY-guts mailing list