File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -769,6 +769,16 @@ func (s *ShapeIndex) Remove(shape Shape) {
769
769
atomic .StoreInt32 (& s .status , stale )
770
770
}
771
771
772
+ // Build triggers the update of the index. Calls to Add and Release are normally
773
+ // queued and processed on the first subsequent query. This has many advantages,
774
+ // the most important of which is that sometimes there *is* no subsequent
775
+ // query, which lets us avoid building the index completely.
776
+ //
777
+ // This method forces any pending updates to be applied immediately.
778
+ func (s * ShapeIndex ) Build () {
779
+ s .maybeApplyUpdates ()
780
+ }
781
+
772
782
// IsFresh reports if there are no pending updates that need to be applied.
773
783
// This can be useful to avoid building the index unnecessarily, or for
774
784
// choosing between two different algorithms depending on whether the index
You can’t perform that action at this time.
0 commit comments