Use an iterator template for enum sequence loops (#1228)

This commit is contained in:
Rangi
2023-11-12 03:19:19 -05:00
committed by GitHub
parent d390db5c57
commit e824e34526
9 changed files with 60 additions and 17 deletions

View File

@@ -15,6 +15,7 @@
#include "extern/utf8decoder.hpp"
#include "error.hpp"
#include "itertools.hpp"
#include "linkdefs.hpp"
#include "platform.hpp" // For `MIN_NB_ELMS` and `AT`
@@ -604,7 +605,7 @@ static void cleanupSections(struct SortedSection *section)
static void cleanup(void)
{
for (enum SectionType type = (enum SectionType)0; type < SECTTYPE_INVALID; type = (enum SectionType)(type + 1)) {
for (enum SectionType type : EnumSeq(SECTTYPE_INVALID)) {
for (uint32_t i = 0; i < sections[type].nbBanks; i++) {
struct SortedSections *bank = &sections[type].banks[i];