Minor optimization in window height measurement