[Bio] / Sprout / Sprout.pm Repository:
ViewVC logotype

Diff of /Sprout/Sprout.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.45, Thu Oct 20 10:20:27 2005 UTC revision 1.46, Thu Oct 20 11:52:36 2005 UTC
# Line 1153  Line 1153 
1153    
1154  =item RETURN  =item RETURN
1155    
1156  Returns a hash mapping the functional assignment IDs to user IDs.  Returns a hash mapping the user IDs to functional assignment IDs.
1157    
1158  =back  =back
1159    
# Line 1168  Line 1168 
1168                              [$featureID], ['Annotation(time)', 'Annotation(annotation)']);                              [$featureID], ['Annotation(time)', 'Annotation(annotation)']);
1169      # Declare the return hash.      # Declare the return hash.
1170      my %retVal;      my %retVal;
     # Declare a hash for insuring we only make one assignment per user.  
     my %timeHash = ();  
1171      # Now we sort the assignments by timestamp in reverse.      # Now we sort the assignments by timestamp in reverse.
1172      my @sortedQuery = sort { -($a->[0] <=> $b->[0]) } @query;      my @sortedQuery = sort { -($a->[0] <=> $b->[0]) } @query;
1173      # Loop until we run out of annotations.      # Loop until we run out of annotations.
# Line 1178  Line 1176 
1176          my ($timeStamp, $text) = @{$annotation};          my ($timeStamp, $text) = @{$annotation};
1177          # Check to see if this is a functional assignment.          # Check to see if this is a functional assignment.
1178          my ($user, $function) = _ParseAssignment($text);          my ($user, $function) = _ParseAssignment($text);
1179          if ($user && ! exists $timeHash{$user}) {          if ($user && ! exists $retVal{$user}) {
1180              # Here it is a functional assignment and there has been no              # Here it is a functional assignment and there has been no
1181              # previous assignment for this user, so we stuff it in the              # previous assignment for this user, so we stuff it in the
1182              # return hash.              # return hash.
1183              $retVal{$function} = $user;              $retVal{$user} = $function;
             # Insure we don't assign to this user again.  
             $timeHash{$user} = 1;  
1184          }          }
1185      }      }
1186      # Return the hash of assignments found.      # Return the hash of assignments found.

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3