what do i use to set the number of positions in a line renderer from code

LineRenderer.SetVertexCount and LineRenderer.numPositions are both obsolete according to unity’s scripting API.
they both work for my code. I was just wandering which one i should use or if the is a third option.

line.positionCount = x;