Slight optimization: seek for maximum function value once per line search