Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ensembl
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
ensembl
Commits
0671cbaf
Commit
0671cbaf
authored
21 years ago
by
Graham McVicker
Browse files
Options
Downloads
Patches
Plain Diff
fixed annoying mixed-case bug in _rearrange method
parent
a24c4e4e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/Bio/EnsEMBL/Root.pm
+14
-13
14 additions, 13 deletions
modules/Bio/EnsEMBL/Root.pm
with
14 additions
and
13 deletions
modules/Bio/EnsEMBL/Root.pm
+
14
−
13
View file @
0671cbaf
...
...
@@ -270,41 +270,42 @@ See Also : L<_initialize>()
sub
_rearrange
{
#----------------
my
(
$self
,
$order
,
@param
)
=
@_
;
return
unless
@param
;
# If we've got parameters, we need to check to see whether
# they are named or simply listed. If they are listed, we
# can just return them.
return
@param
unless
(
defined
(
$param
[
0
])
&&
$param
[
0
]
=~
/^-/
);
# Now we've got to do some work on the named parameters.
# The next few lines strip out the '-' characters which
# preceed the keys, and capitalizes them.
my
$i
;
for
(
$i
=
0
;
$i
<
@param
;
$i
+=
2
)
{
$param
[
$i
]
=~
s/^\-//
;
$param
[
$i
]
=~
tr/a-z/A-Z/
;
$param
[
$i
]
=~
s/^\-//
;
$param
[
$i
]
=~
tr/a-z/A-Z/
;
}
# Now we'll convert the @params variable into an associative array.
local
(
$^W
)
=
0
;
# prevent "odd number of elements" warning with -w.
my
(
%param
)
=
@param
;
my
(
@return_array
);
# What we intend to do is loop through the @{$order} variable,
# and for each value, we use that as a key into our associative
# array, pushing the value at that key onto our return array.
my
(
$key
);
foreach
$key
(
@
{
$order
})
{
my
(
$value
)
=
$param
{
$key
};
delete
$param
{
$key
};
push
(
@return_array
,
$value
);
$key
=
uc
(
$key
);
my
(
$value
)
=
$param
{
$key
};
delete
$param
{
$key
};
push
(
@return_array
,
$value
);
}
return
(
@return_array
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment