No, this function does not care it. A user have a responsibility to check it beforehand and prepare polylines which does not overlap with existing line elements.