1
1

tweaks: avoid recomputing a maximum value every time round the loop

Этот коммит содержится в:
Benno Schulenberg 2019-10-01 13:25:03 +02:00
родитель 78def852d1
Коммит 4df2f81295
2 изменённых файлов: 2 добавлений и 4 удалений

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

@ -432,9 +432,10 @@ int the_code_for(void (*func)(void), int defaultval)
size_t shown_entries_for(int menu)
{
funcstruct *item = allfuncs;
size_t maximum = ((COLS + 40) / 20) * 2;
size_t count = 0;
while (count < MAIN_VISIBLE && item != NULL) {
while (count < maximum && item != NULL) {
if (item->menus & menu)
count++;
item = item->next;

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

@ -629,9 +629,6 @@ enum
#define WAS_MARKED_FORWARD (1<<5)
#endif /* !NANO_TINY */
/* The maximum number of entries displayed in the main shortcut list. */
#define MAIN_VISIBLE (((COLS + 40) / 20) * 2)
/* The default number of columns from end of line where wrapping occurs. */
#define COLUMNS_FROM_EOL 8