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

Function get_price

library/modules/Items.cpp:1372–1377  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1370
1371template<typename T>
1372static int get_price(const vector<T> &res, int32_t val, const vector<int32_t> &pri) {
1373 for (size_t idx = 0; idx < res.size(); ++idx)
1374 if (res[idx] == val)
1375 return vector_get(pri, idx, -1);
1376 return -1;
1377}
1378
1379template<typename T1, typename T2>
1380static int get_price(const vector<T1> &mat_res, int32_t mat, const vector<T2> &gloss_res,

Callers 1

Calls 2

vector_getFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected