Ticket #2774 (closed feature: fixed)

Opened 3 years ago

Last modified 3 years ago

add removeAllFeatures

Reported by: tschaub Owned by: crschmidt
Priority: minor Milestone: 2.10 Release
Component: Layer.Vector Version: 2.9
Keywords: Cc:
State: Complete

Description

The removeFeatures method does a fair bit of unnecessary work in cases where all features are being removed. In addition, the renderer clear method can be optimized.

Attachments

2774.patch Download (3.2 KB) - added by tschaub 3 years ago.
fast track for remove all

Change History

Changed 3 years ago by tschaub

fast track for remove all

Changed 3 years ago by tschaub

  • state set to Review

Tests passing.

Changed 3 years ago by ahocevar

  • state changed from Review to Commit

Tim, this is solid work! Thanks for the optimization. Please commit.

Changed 3 years ago by tschaub

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [10597]) Adding a removeAllFeatures method to the vector layer. This bypasses a few unnecessary steps when removing all features but retains the same behavior as the removeFeatures method otherwise. Optimizing the clear method on elements renderers a bit by avoiding length calculation of the live collection and looking up the first child once per node removal. r=ahocevar (closes #2774)

Note: See TracTickets for help on using tickets.