MCPcopy Create free account
hub / github.com/beefytech/Beef / FindIndex

Method FindIndex

IDEHelper/Backend/BeMCContext.cpp:620–637  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

618}
619
620int BeVTrackingContext::FindIndex(BeVTrackingList* entry, int val)
621{
622 int lo = 0;
623 int hi = entry->mSize - 1;
624
625 while (lo <= hi)
626 {
627 int i = (lo + hi) / 2;
628 int midVal = entry->mEntries[i];
629 int c = midVal - val;
630 if (c == 0) return i;
631 if (c < 0)
632 lo = i + 1;
633 else
634 hi = i - 1;
635 }
636 return ~lo;
637}
638
639bool BeVTrackingContext::IsSet(BeVTrackingList* entry, int idx)
640{

Callers 1

InitializedPassHelperMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected