4 ms·
I guarantee that piece of code has a comment like /* This should never happen */ if (waypoints.matchcount > 2) {
by convivialdingo 2y ago
I guarantee that piece of code has a comment like
/* This should never happen */
if (waypoints.matchcount > 2) {
- crubier 2y agoPossibly 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.
- gopher_space 2y agoRace condition?
- deleted 2y ago[deleted]
- CaptainFever 2y agoSilently ignoring conditions where there are multiple or zero elements?
- gitaarik 2y agoDon't you mean > 1 ?
- dx034 2y agoFrom the text it sounds like it looked up if a code was in the flight plan and at which position it was in the plan. It never looked up two codes or assumed there code only be one, just comparing how the plan was filed. I'm sure there'd be a better way to handle this, but it sounds to me like the system failed in a graceful way and acted as specified.