diff options
author | Josh Triplett <josh@joshtriplett.org> | 2016-06-24 15:59:37 -0700 |
---|---|---|
committer | Josh Triplett <josh@joshtriplett.org> | 2016-06-24 16:02:52 -0700 |
commit | 2b490284959998167c095433693e9e7e66d25d6c (patch) | |
tree | bdb425a49d7f96d689cbb81bf442f4da4fb71c91 /tests/diff/diffiter.c | |
parent | 0dd98b6905a8a0f5f88ea89fa55d663c02c5aeb2 (diff) | |
download | libgit2-2b490284959998167c095433693e9e7e66d25d6c.tar.gz |
find_repo: Clean up and simplify logic
find_repo had a complex loop and heavily nested conditionals, making it
difficult to follow. Simplify this as much as possible:
- Separate assignments from conditionals.
- Check the complex loop condition in the only place it can change.
- Break out of the loop on error, rather than going through the rest of
the loop body first.
- Handle error cases by immediately breaking, rather than nesting
conditionals.
- Free repo_link unconditionally on the way out of the function, rather
than in multiple places.
- Add more comments on the remaining complex steps.
Diffstat (limited to 'tests/diff/diffiter.c')
0 files changed, 0 insertions, 0 deletions