1
1

tweaks: when OR'ing, put the most likely condition first

Also, slightly reword a comment, adjust some whitespace, and use
a more direct comparison for equality.
Этот коммит содержится в:
Benno Schulenberg 2019-04-28 15:53:33 +02:00
родитель d54180ad8b
Коммит 896cfcef95

Просмотреть файл

@ -450,15 +450,15 @@ void remove_magicline(void)
#endif
#ifndef NANO_TINY
/* Set (top, top_x) and (bot, bot_x) to the start and end "coordinates" of
* the marked region. If right_side_up isn't NULL, set it to TRUE when the
* mark is at the top of the marked region, and to FALSE otherwise. */
/* Return in (top, top_x) and (bot, bot_x) the start and end "coordinates"
* of the marked region. If right_side_up isn't NULL, set it to TRUE when
* the mark is at the top of the marked region, and to FALSE otherwise. */
void get_region(const linestruct **top, size_t *top_x,
const linestruct **bot, size_t *bot_x, bool *right_side_up)
const linestruct **bot, size_t *bot_x, bool *right_side_up)
{
if ((openfile->current->lineno == openfile->mark->lineno &&
openfile->current_x > openfile->mark_x) ||
openfile->current->lineno > openfile->mark->lineno) {
if (openfile->mark->lineno < openfile->current->lineno ||
(openfile->mark == openfile->current &&
openfile->mark_x < openfile->current_x)) {
*top = openfile->mark;
*top_x = openfile->mark_x;
*bot = openfile->current;