Foreach saferemove causes infinite loop
#4

I also tried that.

Код:
	foreach(new serveritemid : ServerItems)
	{
		count[serveritemid]++;
		if(count[serveritemid] == 3)
		{
			new next;
			Iter_SafeRemove(ServerItems, serveritemid, next);
			serveritemid = next;
		}
		if(!Iter_Count(ServerItems))
		{
			printf("ServerItems empty");
		}
		printf("%d", serveritemid);
	}
Код HTML:
[2017/10/01 19:31:32] 0
[2017/10/01 19:31:32] 1
[2017/10/01 19:31:32] 2
[2017/10/01 19:31:32] 3
[2017/10/01 19:31:32] 4
[2017/10/01 19:31:32] 5
[2017/10/01 19:31:32] 6
[2017/10/01 19:31:34] 0
[2017/10/01 19:31:34] 1
[2017/10/01 19:31:34] 2
[2017/10/01 19:31:34] 3
[2017/10/01 19:31:34] 4
[2017/10/01 19:31:34] 5
[2017/10/01 19:31:34] 6
[2017/10/01 19:31:36] 1000
[2017/10/01 19:31:36] 1000
[2017/10/01 19:31:36] 0
[2017/10/01 19:31:36] 1
[2017/10/01 19:31:36] 2
[2017/10/01 19:31:36] 3
[2017/10/01 19:31:36] ServerItems empty
[2017/10/01 19:31:36] 4
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 2
[2017/10/01 19:31:36] ServerItems empty
[2017/10/01 19:31:36] 4
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 2
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
[2017/10/01 19:31:38] ServerItems empty
[2017/10/01 19:31:38] 5
Reply


Messages In This Thread
Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 14:27
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 16:22
Re: Foreach saferemove causes infinite loop - by raydx - 01.10.2017, 17:18
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 17:32
Re: Foreach saferemove causes infinite loop - by Marricio - 01.10.2017, 18:45
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:06
Re: Foreach saferemove causes infinite loop - by None1337 - 01.10.2017, 19:11
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:15
Re: Foreach saferemove causes infinite loop - by None1337 - 01.10.2017, 19:24
Re: Foreach saferemove causes infinite loop - by m4karow - 01.10.2017, 19:28

Forum Jump:


Users browsing this thread: 3 Guest(s)