Replace two array with a map type, make it easier to understand. Upstream-commit: 8643903e49c2d25272e59fe09a75803aa05ed841 Component: engine