Minor optimization to gamepad code