Tip from Dan Kortschak to avoid map lookups.