tweaks: elide an unneeded 'if' and 'break'
parent
e84a790b5d
commit
18eb7e6d21
10
src/search.c
10
src/search.c
|
@ -973,8 +973,7 @@ void do_find_bracket(void)
|
||||||
strncpy(bracket_pair + ch_len, wanted_ch, wanted_ch_len);
|
strncpy(bracket_pair + ch_len, wanted_ch, wanted_ch_len);
|
||||||
bracket_pair[ch_len + wanted_ch_len] = '\0';
|
bracket_pair[ch_len + wanted_ch_len] = '\0';
|
||||||
|
|
||||||
while (TRUE) {
|
while (find_a_bracket(reverse, bracket_pair)) {
|
||||||
if (find_a_bracket(reverse, bracket_pair)) {
|
|
||||||
/* If we found an identical bracket, increment balance. If we
|
/* If we found an identical bracket, increment balance. If we
|
||||||
* found a complementary bracket, decrement it. */
|
* found a complementary bracket, decrement it. */
|
||||||
balance += (strncmp(openfile->current->data + openfile->current_x,
|
balance += (strncmp(openfile->current->data + openfile->current_x,
|
||||||
|
@ -984,16 +983,13 @@ void do_find_bracket(void)
|
||||||
* the screen and get out. */
|
* the screen and get out. */
|
||||||
if (balance == 0) {
|
if (balance == 0) {
|
||||||
edit_redraw(was_current, FLOWING);
|
edit_redraw(was_current, FLOWING);
|
||||||
break;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
/* We didn't find either an opening or closing bracket.
|
/* We didn't find either an opening or closing bracket.
|
||||||
* Indicate this, restore where we were, and get out. */
|
* Indicate this, restore where we were, and get out. */
|
||||||
statusbar(_("No matching bracket"));
|
statusbar(_("No matching bracket"));
|
||||||
openfile->current = was_current;
|
openfile->current = was_current;
|
||||||
openfile->current_x = was_current_x;
|
openfile->current_x = was_current_x;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#endif /* !NANO_TINY */
|
#endif /* !NANO_TINY */
|
||||||
|
|
Loading…
Reference in New Issue