Optimize Line collision-detection.