Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
dc967daf
Commit
dc967daf
authored
Apr 11, 2008
by
Leigh B. Stoller
Browse files
Add SameExperiment method.
parent
ef9ff2a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/Experiment.pm.in
View file @
dc967daf
...
...
@@ -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);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment