1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Made for (var i < GetVal()) only call GetVal() once

This commit is contained in:
Brian Fiete 2021-07-16 09:06:31 -07:00
parent 70da0856a7
commit e3bdacf505
2 changed files with 15 additions and 2 deletions

View file

@ -5845,8 +5845,6 @@ void BfModule::DoForLess(BfForEachStatement* forEachStmt)
// Cond
auto valueScopeStart = ValueScopeStart();
auto localVal = mBfIRBuilder->CreateLoad(localDef->mAddr);
if ((forEachStmt->mCollectionExpression != NULL) && (!didInference))
target = CreateValueFromExpression(forEachStmt->mCollectionExpression, varType);
if (!target)
{
// Soldier on