Skip to content

Commit 68c00b9

Browse files
cgzonesBenBE
authored andcommitted
Header: cache number of columns in HeaderLayout_getColumns
The header layout, and therefore the number of columns, should never be changed within such loop.
1 parent 3c8d586 commit 68c00b9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ typedef struct Header_ {
2323
int height;
2424
} Header;
2525

26-
#define Header_forEachColumn(this_, i_) for (size_t (i_)=0; (i_) < HeaderLayout_getColumns((this_)->headerLayout); ++(i_))
26+
#define Header_forEachColumn(this_, i_) for (size_t (i_)=0, H_fEC_numColumns_ = HeaderLayout_getColumns((this_)->headerLayout); (i_) < H_fEC_numColumns_; ++(i_))
2727

2828
Header* Header_new(ProcessList* pl, Settings* settings, HeaderLayout hLayout);
2929

0 commit comments

Comments
 (0)