Again, suggest using `if (!(ret in GROUP_ORDER)) {` here to avoid an array scan.