MCPcopy Create free account
hub / github.com/DFHack/dfhack / linear_index

Function linear_index

library/include/MiscUtils.h:102–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101template <typename FT>
102int linear_index(const std::vector<FT> &vec, FT key)
103{
104 for (unsigned i = 0; i < vec.size(); i++)
105 if (vec[i] == key)
106 return i;
107 return -1;
108}
109
110template <typename FT>
111int linear_index(const std::vector<FT*> &vec, const FT &key)

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected