Comments (3)
Sorry for the late response, I've been traveling. Thanks for catching this, since from
or to
could also potentially be null
I've changed it to this:
public int hashCode() {
if (hash == -1) {
hash = Objects.hashCode(from) ^ Objects.hashCode(to) ^ Objects.hashCode(value);
}
return hash;
}
from bifurcan.
There is some overhead with Objects.hash
, but I believe my original rationale was to have equivalent hashes for undirected edges. On reflection, however, that doesn't also hold true for the equality check, so it probably makes sense to have DirectedEdge
and UndirectedEdge
classes.
from bifurcan.
Hey, great thanks for fixing this :-)
BTW: Great library, has been really helpful on a project I'm working on :-)
Just out of interest: Can you tell me the advantage from xoring the different hashCodes over calling Objects#hash? Is it the array allocation?
from bifurcan.
Related Issues (20)
- `DirectedGraph#edge(V, V)` can be improved by removing the `Optional` allocation HOT 2
- Add ability to create subclasses HOT 1
- Do several methods mutate the internals of immutable List instances? HOT 3
- Some List RRB trees constructed deeper than necessary
- bug in List removeLast method HOT 2
- concat then slice throws exception with some List instances HOT 2
- Minor: redundant defn of benchmark-iteration in benchmark-test ns
- No documentation about the maximum number of elements that can be stored in a List HOT 1
- Bug - remove fails on VirtualMap HOT 2
- add methods for type-safe creation of empty instances
- AIOOBE on List slice/concat usage HOT 4
- What's in the 0.2.0-alpha2 release? HOT 4
- Iterator is incorrect after remove on Linear Map HOT 3
- Possible NPE in MapNodes#put HOT 5
- timing in clojure gives slower results than clojure's persistent datastructures on inserts HOT 4
- Upscaling/Downscaling between the Bifurcan List and the Clojure Vector
- Confusion over when to use linear/forked HOT 12
- Possible accidental mutation HOT 1
- Forked set is modified after baked linear set modification HOT 1
- Sliced list cannot be made linear
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bifurcan.