summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2021-09-10 16:34:20 +0200
committerBenBE <BenBE@geshi.org>2021-09-12 18:35:24 +0200
commit68c00b9cdb8ea9a841f322effb385efce1436573 (patch)
treedfb51f3a00d0b1c15972fd6346ca6f61b83457a5
parent3c8d586a1c936bc5e2c9424485485f1911b54e77 (diff)
Header: cache number of columns in HeaderLayout_getColumns
The header layout, and therefore the number of columns, should never be changed within such loop.
-rw-r--r--Header.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Header.h b/Header.h
index c6f1a347..060ad02d 100644
--- a/Header.h
+++ b/Header.h
@@ -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);

© 2014-2024 Faster IT GmbH | imprint | privacy policy