MCPcopy Create free account
hub / github.com/audacity/audacity / Find

Method Find

libraries/lib-snapping/Snap.cpp:138–153  ·  view source on GitHub ↗

Find the index where this SnapPoint should go in sorted order, between i0 (inclusive) and i1 (exclusive).

Source from the content-addressed store, hash-verified

136// Find the index where this SnapPoint should go in
137// sorted order, between i0 (inclusive) and i1 (exclusive).
138size_t SnapManager::Find(double t, size_t i0, size_t i1)
139{
140 if (i1 <= i0 + 1)
141 {
142 return i0;
143 }
144
145 size_t half = (i0 + i1) / 2;
146
147 if (t < Get(half))
148 {
149 return Find(t, i0, half);
150 }
151
152 return Find(t, half, i1);
153}
154
155// Find the SnapPoint nearest to time t
156size_t SnapManager::Find(double t)

Callers 2

InitMethod · 0.45
ToDisplayStringMethod · 0.45

Calls 3

GetFunction · 0.85
FindFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected