Re: [PATCH v2] sequencer: break out of loop explicitly

2018-10-31 Thread Martin Ågren
On Wed, 31 Oct 2018 at 18:28, Eric Sunshine wrote: > > On Wed, Oct 31, 2018 at 10:54 AM Johannes Schindelin > wrote: > > ACK. Thanks for cleaning up after me, > > Looks good to me, as well. Thanks for working on it. Thanks, both of you. Martin

Re: [PATCH v2] sequencer: break out of loop explicitly

2018-10-31 Thread Eric Sunshine
On Wed, Oct 31, 2018 at 10:54 AM Johannes Schindelin wrote: > On Tue, 30 Oct 2018, Martin Ågren wrote: > > Rewrite the loop to a more idiomatic variant which doesn't muck with > > `len` in the loop body. That should help compilers and human readers > > figure out what is going on here. But do

Re: [PATCH v2] sequencer: break out of loop explicitly

2018-10-31 Thread Johannes Schindelin
Hi Martin, On Tue, 30 Oct 2018, Martin Ågren wrote: > It came up in review [1, 2] that this non-idiomatic loop is a bit tricky. > When we find a space, we set `len = i`, which gives us the answer we are > looking for, but which also breaks out of the loop. > > It turns out that this loop can

[PATCH v2] sequencer: break out of loop explicitly

2018-10-30 Thread Martin Ågren
It came up in review [1, 2] that this non-idiomatic loop is a bit tricky. When we find a space, we set `len = i`, which gives us the answer we are looking for, but which also breaks out of the loop. It turns out that this loop can confuse compilers as well. My copy of gcc 7.3.0 realizes that we