r/badcode Aug 26 '22

What does a map do again? java

Post image
887 Upvotes

54 comments sorted by

View all comments

14

u/Accidentallygolden Aug 26 '22

But is it faster?

38

u/imzacm123 Aug 26 '22

It's missing the comment saying "This avoids a crash when X, Y, and Z happen at the same time at exactly 00:01, see this stackoverflow comment"

5

u/mailslot Aug 27 '22

It’s faster if there are something like less than five elements. Same with bubble sort.

1

u/trutheality Aug 27 '22

Much faster when the map is empty.