RhinoPythonPrimerRev3 question

Hello everyone,
I’m currently following RhinoPythonPrimerRev3. I have a question on the script written on page 29 : (my question is regarding the highlighted line, number 15)

def fitcurvetolength():
curve_id = rs.GetObject(“pick a curve”, rs.filter.curve, True, True)
if curve_id is None: return
length = rs.CurveLength(curve_id)
length_limit = rs.GetReal(“length”, 0.5length, 0.01length, length)
if length_limit is None: return
while True:
if rs.CurveLength(curve_id)<= length_limit: break
curve_id = rs.ScaleObject(curve_id, (0,0,0), (0.95,0.95,0.95))

if curve_id is None:
print(“something went wrong”)

print ("New curve length: ", rs.CurveLength(curve_id))

if name== “main”:

it seems contradictory to set a new length for the new curve then recale it with a factor that will make the new length not similar to the one that was set earlier. To me it makes more sense to set the scaling factor to length_limit/length. Could someone clarify? Thank you!