Skip to content

Commit

Permalink
simplified equals
Browse files Browse the repository at this point in the history
  • Loading branch information
ga2arch committed Apr 19, 2016
1 parent ab50763 commit b53621f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Expand Up @@ -44,7 +44,7 @@ public void run() {
Log.e(LOG_TAG, e.getMessage(), e);

} finally {
running.remove(semaphore);
running.remove(actorRef);
}
}
});
Expand Down
9 changes: 1 addition & 8 deletions src/main/java/com/gabriele/actor/internals/ActorRef.java
Expand Up @@ -2,7 +2,6 @@

import com.gabriele.actor.exceptions.ActorIsTerminatedException;

import java.lang.ref.Reference;
import java.lang.ref.WeakReference;

public class ActorRef extends WeakReference<AbstractActor> {
Expand Down Expand Up @@ -42,12 +41,6 @@ public int hashCode() {

@Override
public boolean equals(Object other) {
if (other instanceof AbstractActor) {
return get() == other;
}
if (other instanceof Reference) {
return get() == ((Reference) other).get();
}
return get() == other;
return other.hashCode() == hashCode;
}
}

0 comments on commit b53621f

Please sign in to comment.