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.
Этот коммит содержится в:
родитель
d54180ad8b
Коммит
896cfcef95
14
src/utils.c
14
src/utils.c
@ -450,15 +450,15 @@ void remove_magicline(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NANO_TINY
|
#ifndef NANO_TINY
|
||||||
/* Set (top, top_x) and (bot, bot_x) to the start and end "coordinates" of
|
/* Return in (top, top_x) and (bot, bot_x) the start and end "coordinates"
|
||||||
* the marked region. If right_side_up isn't NULL, set it to TRUE when the
|
* of the marked region. If right_side_up isn't NULL, set it to TRUE when
|
||||||
* mark is at the top of the marked region, and to FALSE otherwise. */
|
* the mark is at the top of the marked region, and to FALSE otherwise. */
|
||||||
void get_region(const linestruct **top, size_t *top_x,
|
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 &&
|
if (openfile->mark->lineno < openfile->current->lineno ||
|
||||||
openfile->current_x > openfile->mark_x) ||
|
(openfile->mark == openfile->current &&
|
||||||
openfile->current->lineno > openfile->mark->lineno) {
|
openfile->mark_x < openfile->current_x)) {
|
||||||
*top = openfile->mark;
|
*top = openfile->mark;
|
||||||
*top_x = openfile->mark_x;
|
*top_x = openfile->mark_x;
|
||||||
*bot = openfile->current;
|
*bot = openfile->current;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user