small optimization in TOV solver