Re: Removing array element in foreach, safe?

2016-09-05 Thread dom via Digitalmars-d-learn
On Monday, 5 September 2016 at 17:38:10 UTC, Daniel Kozak wrote: On Monday, 5 September 2016 at 15:53:39 UTC, dom wrote: is this code safe? if not how do i do it correctly? static AsyncHttpGet[] openRequests; static void updateRequests() { foreach(idx,

Re: Removing array element in foreach, safe?

2016-09-05 Thread Daniel Kozak via Digitalmars-d-learn
On Monday, 5 September 2016 at 17:38:10 UTC, Daniel Kozak wrote: On Monday, 5 September 2016 at 15:53:39 UTC, dom wrote: is this code safe? if not how do i do it correctly? static AsyncHttpGet[] openRequests; static void updateRequests() { foreach(idx,

Re: Removing array element in foreach, safe?

2016-09-05 Thread Daniel Kozak via Digitalmars-d-learn
On Monday, 5 September 2016 at 15:53:39 UTC, dom wrote: is this code safe? if not how do i do it correctly? static AsyncHttpGet[] openRequests; static void updateRequests() { foreach(idx, req; openRequests) {

Removing array element in foreach, safe?

2016-09-05 Thread dom via Digitalmars-d-learn
is this code safe? if not how do i do it correctly? static AsyncHttpGet[] openRequests; static void updateRequests() { foreach(idx, req; openRequests) { if(req.state != Fiber.State.TERM)