line.squaredLength()

Return the squared length of the line. Useful in cases the real length is not necessary (saves the Math.sqrt() operation).