Switched optimization passes to use an array of arrays with direct lookup.