⚡ Remove redundant path.move in polyline snapshot loop - #26
Conversation
Co-authored-by: esenmx <43244505+esenmx@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Guard comment above the move(to:) so the per-segment move is not re-added: lineJoin and dash phase only apply within one subpath, matching MKPolylineRenderer. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
💡 What:
Removed the redundant
path.move(to: snapshot.point(for: coordinate))call inside the polyline point iteration loop inFlutterPolyline.swiftand updated the iteration to usecoordinates.dropFirst().🎯 Why:
$N$ to $2N$ ), increasing memory overhead, and breaking line joins across polyline segments.
path.addLine(to:)inUIBezierPathautomatically updates the current point of the path. Callingmove(to:)after every segment creates a new subpath for each segment, doublingsnapshot.point(for:)lookups per point (from📊 Measured Improvement:
Direct execution of native Swift benchmarks is not supported in the Linux sandbox environment. However, algorithmically:
PR created automatically by Jules for task 13544136725387948932 started by @esenmx