mirror of
https://github.com/gbdev/rgbds.git
synced 2026-10-06 04:05:38 +00:00
Implement reversed template for reversing for-each loops
This commit is contained in:
1 parent
fba0562650
commit
02c2408f58
4 files changed
+27
-6
No files matched your search
+3
-2
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "backtrace.hpp"
|
||||
#include "helpers.hpp"
|
||||
#include "itertools.hpp" // reversed
|
||||
#include "linkdefs.hpp"
|
||||
#include "platform.hpp" // strncasecmp
|
||||
#include "verbosity.hpp"
|
||||
@@ -295,9 +296,9 @@ static void
|
||||
}
|
||||
if (macro.src->type == NODE_REPT) {
|
||||
std::vector<uint32_t> const &srcIters = macro.src->iters();
|
||||
for (uint32_t i = srcIters.size(); i--;) {
|
||||
for (uint32_t iter : reversed(srcIters)) {
|
||||
fileInfoName.append(NODE_SEPARATOR REPT_NODE_PREFIX);
|
||||
fileInfoName.append(std::to_string(srcIters[i]));
|
||||
fileInfoName.append(std::to_string(iter));
|
||||
}
|
||||
}
|
||||
fileInfoName.append(NODE_SEPARATOR);
|
||||
|
||||
Reference in new issue
Block a user