Header: cache number of columns in HeaderLayout_getColumns

The header layout, and therefore the number of columns, should never
be changed within such loop.
This commit is contained in:
Christian Göttsche 2021-09-10 16:34:20 +02:00 committed by BenBE
parent 3c8d586a1c
commit 68c00b9cdb
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ typedef struct Header_ {
int height;
} Header;
#define Header_forEachColumn(this_, i_) for (size_t (i_)=0; (i_) < HeaderLayout_getColumns((this_)->headerLayout); ++(i_))
#define Header_forEachColumn(this_, i_) for (size_t (i_)=0, H_fEC_numColumns_ = HeaderLayout_getColumns((this_)->headerLayout); (i_) < H_fEC_numColumns_; ++(i_))
Header* Header_new(ProcessList* pl, Settings* settings, HeaderLayout hLayout);