`setTag()` uses a command -> tag map. This function is looking up a command in a different map, hence the linear search.