Skip to content
Snippets Groups Projects
Commit fc20a27b authored by Andreas Kusalananda Kähäri's avatar Andreas Kusalananda Kähäri
Browse files

In equals(): Test for identity even before calling assert_ref() on the

argument.
parent e6f88fbc
No related branches found
No related tags found
No related merge requests found
......@@ -418,13 +418,13 @@ sub slice {
sub equals {
my ( $self, $feature ) = @_;
assert_ref( $feature, 'Bio::EnsEMBL::Feature' );
# If the features are the same object, they are equal.
if ( $self eq $feature ) {
return 1;
}
assert_ref( $feature, 'Bio::EnsEMBL::Feature' );
# If the features have different types, they are *not* equal.
if ( ref($self) ne ref($feature) ) {
return 0;
......
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