[Olena-patches] 2304: Improve the handling of a possibly unused variable in line_gradient.