CE/improve runs

i can delete:

  } else if (error)

{

return;

}


and instead return if errorReturned == YES as the first check in the result
block


how do you feel about that?

On Mon, Nov 3, 2014 at 4:38 PM, Fabian <notifications@github.com> wrote:

> In RandomRun/Run.m:
>
> > -                                  result:^(NSArray *routes, NSError *error) {
> > -                                      if (routes) {
> > +    BOOL __block errorReturned;
> > +    NSUInteger __block retryCount = 0;
> > +    void (^retryRunLoadUntilValid)(id) = ^void(id continueBlock) {
> > +        [self loadRoutesWithStartingLocation:startingCoordinate
> > +                              targetDistance:distance
> > +                                      result:^(NSArray *routes, NSError *error) {
> > +                                          if (error && errorReturned == NO) {
> > +                                              completion(nil, error);
> > +                                              errorReturned = YES;
> > +                                              return;
> > +                                          } else if (error) {
> > +                                              return;
> > +                                          }
> > +
>
> Why does that matter? I know we can't abort the calls, but we can know
> that we don't need to process the results.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/mojotech/random-run/pull/5/files#r19768224>.
>