Skip to content

Commit

Permalink
Novice error: Add hashCode() & equals() for comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
subbuss committed Oct 10, 2014
1 parent 527303f commit 71cddf0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions core/src/main/java/org/jruby/ir/passes/CompilerPass.java
Expand Up @@ -30,6 +30,16 @@ public abstract class CompilerPass {
*/
public abstract String getLabel();

@Override
public int hashCode() {
return getLabel().hashCode();
}

@Override
public boolean equals(Object other) {
return (other != null) && (other instanceof CompilerPass) && (getLabel() == ((CompilerPass)other).getLabel());
}

/**
* Meat of an individual pass. run will call this after dependency
* resolution.
Expand Down

0 comments on commit 71cddf0

Please sign in to comment.