MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / AddToSet

Function AddToSet

src/Chain/libraries/glua/glua_structs.cpp:228–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

226 }
227
228 int AddToSet(IntSet* set, int a) {
229 IntSetItem* item;
230 if (!set->mayRepeat) {
231 ListItem* ptr = set->list.head;
232 while (ptr) {
233 if (lua_cast(IntSetItem*, ptr)->value == a) {
234 return 0;
235 }
236 ptr = ptr->next;
237 }
238 }
239 item = new IntSetItem();
240 item->value = a;
241 AddToList(&(set->list), (ListItem*)item);
242 return 1;
243 }
244
245 int PeekSet(IntSet* set, int a) {
246 ListItem* ptr = set->list.head;

Callers 2

AssignRegFunction · 0.85
ProcessCodeFunction · 0.85

Calls 1

AddToListFunction · 0.85

Tested by

no test coverage detected