MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / FindItem

Method FindItem

source/script_object.cpp:2217–2236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2215//
2216
2217Map::Pair *Map::FindItem(IntKeyType val, index_t left, index_t right, index_t &insert_pos)
2218// left and right must be set by caller to the appropriate bounds within mItem.
2219{
2220 while (left < right)
2221 {
2222 index_t mid = left + ((right - left) >> 1);
2223 auto &item = mItem[mid];
2224
2225 auto result = val - item.key.i;
2226
2227 if (result < 0)
2228 right = mid;
2229 else if (result > 0)
2230 left = mid + 1;
2231 else
2232 return &item;
2233 }
2234 insert_pos = left;
2235 return nullptr;
2236}
2237
2238Object::FieldType *Object::FindField(name_t name, index_t &insert_pos)
2239{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected