Commit dc967daf authored by Leigh B. Stoller's avatar Leigh B. Stoller

Add SameExperiment method.

parent ef9ff2a9
......@@ -247,6 +247,20 @@ sub LookupByIndex($$)
return Experiment->Lookup($exptidx);
}
#
# Equality test. Not strictly necessary in perl, but good form.
#
sub SameExperiment($$)
{
my ($self, $other) = @_;
# Must be a real reference.
return -1
if (! (ref($self) && ref($other)));
return $self->idx() == $other->idx();
}
#
# All active experiments.
#
......@@ -280,7 +294,9 @@ sub UserExperimentList($$$)
my $query_result =
DBQueryWarn("select idx from experiments ".
"where creator_idx='$uid_idx' or swapper_idx='$uid_idx'");
"where creator_idx='$uid_idx' or ".
" (swapper_idx='$uid_idx' and ".
" state!='" . EXPTSTATE_SWAPPED() . "'");
return -1
if (! $query_result);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment