hm...

Since they vertices are cached, equality really is reference equality, so I
guess you're right and I should remove hashCode, too.

On the other hand, it is not possible for two vertices to hold the same
data, so it would be ok, but for different reasons.

I'll just go on and remove hashCode, too.

thanks!



2014-03-03 21:10 GMT+02:00 dwightguth <notifications@github.com>:

> In
> src/javasources/KTool/src/org/kframework/backend/pdmc/pda/graph/TarjanSCC.java:
>
> > @@ -35,11 +38,6 @@ public TarjanSCC() {
> >          }
> >
> >          @Override
> > -        public boolean equals(Object o) {
>
> No, you don't need to add it back in. But if you are doing reference
> equality then overriding hashCode will degrade performance of your object
> in a map key, because you are unnecessarily hashing different objects to
> the same bucket.
> … <#144895a5c662c866_>
> On Mon, Mar 3, 2014 at 10:40 AM, traiansf <notifications@github.com>
> wrote: In
> src/javasources/KTool/src/org/kframework/backend/pdmc/pda/graph/TarjanSCC.java:
> > @@ -35,11 +38,6 @@ public TarjanSCC() { > } > > @Override<https://github.com/Override>> - public boolean equals(Object o) { I did implement equals as == but got
> a (soft) warning that I should check for the class first. As that seemed
> silly and anyway equals does == by default, I said I don't really need it.
> I can add it back if you think it makes code more clear, though. 2014-03-03
> 20:30 GMT+02:00 dwightguth < notifications@github.com>: ...
> <#144893fb951faf2c_> In
> src/javasources/KTool/src/org/kframework/backend/pdmc/pda/graph/TarjanSCC.java:
> > @@ -35,11 +38,6 @@ public TarjanSCC() { > } > > @Override<https://github.com/Override>
> <https://github.com/Override>> - public boolean equals(Object o) { Is
> there a particular reason you implemented hashCode but not equals? It looks
> safe according to the contract, I'm just curious. -- Reply to this email
> directly or view it on GitHub<
> https://github.com/kframework/k/pull/254/files#r10221911> . -- Reply to
> this email directly or view it on GitHub<
> https://github.com/kframework/k/pull/254/files#r10222380> .
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kframework/k/pull/254/files#r10223567>
> .
>