Commit 94d17e60 by Liang ZOU Committed by Zhi

[codegen][Build] it's more readable to move the if condition out of the loop (#4501)

parent a05f73e9
...@@ -41,8 +41,8 @@ runtime::Module Build(const Array<LoweredFunc>& funcs, ...@@ -41,8 +41,8 @@ runtime::Module Build(const Array<LoweredFunc>& funcs,
mode = mode.substr(0, pos); mode = mode.substr(0, pos);
} }
Array<LoweredFunc> transformed_funcs; Array<LoweredFunc> transformed_funcs;
for (const auto& x : funcs) { if (BuildConfig::Current()->disable_assert) {
if (BuildConfig::Current()->disable_assert) { for (const auto& x : funcs) {
auto func = ir::SkipAssert(x); auto func = ir::SkipAssert(x);
transformed_funcs.push_back(func); transformed_funcs.push_back(func);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment