Hacker News new | ask | show | jobs
by crubier 579 days ago
Possibly even just

    waypoint = waypointsMatches[0]
Without even mentioning that waypointsMatches might have multiple elements.

This is why I always consider [0] to be a code smell. It doesn't have a name afaik, but it should.

2 comments

Silently ignoring conditions where there are multiple or zero elements?
Race condition?