The compiler may be able to optimize that for us, but you may want to create a local `map` variable here (`getMap()` is called three times in this function).