Updating Roy's submission

* Added tests for endian-calculations (had these in a different class, perhaps handy for others to see as well)

Inlined the hash function, runs locally in 2.4sec now, hopefully endian issues fix

Added equals to support any city name up to 1024 in length, don't rely on hash

* For clarity I've updated the code so endian doesn't change the hashes, easier to debug.

* Fixing bug in array check

Simple is faster

* Also spotted the diff, not just the big exception

Fixed buffer limit issue
This commit is contained in:
Roy van Rijn
2024-01-04 23:22:48 +01:00
committed by GitHub
parent acb6510a02
commit 1c74049991
2 changed files with 226 additions and 79 deletions

View File

@@ -15,7 +15,7 @@
# limitations under the License.
#
sdk use java 21.0.1-graal
# Added for fun, doesn't seem to be making a difference...
if [ -f "target/calculate_average_royvanrijn.jsa" ]; then
JAVA_OPTS="-XX:SharedArchiveFile=target/calculate_average_royvanrijn.jsa -Xshare:on"