tweaks: avoid recomputing a maximum value every time round the loop
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user