| 1399 | */ |
| 1400 | |
| 1401 | static bool complex_enum_next_item_helper(lua_State *L, int64_t &item, bool wrap = false) |
| 1402 | { |
| 1403 | const auto *complex = (enum_identity::ComplexData*)lua_touserdata(L, lua_upvalueindex(2)); |
| 1404 | auto it = complex->value_index_map.find(item); |
| 1405 | if (it != complex->value_index_map.end()) |
| 1406 | { |
| 1407 | size_t index = it->second; |
| 1408 | if (!wrap && index >= complex->size() - 1) |
| 1409 | return false; |
| 1410 | |
| 1411 | item = complex->index_value_map[(index + 1) % complex->size()]; |
| 1412 | return true; |
| 1413 | } |
| 1414 | return false; |
| 1415 | } |
| 1416 | |
| 1417 | static int complex_enum_inext(lua_State *L) |
| 1418 | { |
no test coverage detected