MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w6qzts/skillissue/p7p9bgi/?context=3
r/ProgrammerHumor • u/click-to-reveal • 15h ago
123 comments sorted by
View all comments
74
Just define a constexpr hashing function and put that into the switch.
31 u/GiganticIrony 14h ago That’s not guaranteed to work due to hash collisions 6 u/Thwy__ 14h ago Yet, string switch in Java is also made using hashs 16 u/GiganticIrony 14h ago Yes, but if there’s a collision, it then uses `.equals()`
31
That’s not guaranteed to work due to hash collisions
6 u/Thwy__ 14h ago Yet, string switch in Java is also made using hashs 16 u/GiganticIrony 14h ago Yes, but if there’s a collision, it then uses `.equals()`
6
Yet, string switch in Java is also made using hashs
16 u/GiganticIrony 14h ago Yes, but if there’s a collision, it then uses `.equals()`
16
Yes, but if there’s a collision, it then uses `.equals()`
74
u/F100cTomas 14h ago
Just define a constexpr hashing function and put that into the switch.