| 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; |
no test coverage detected