Different code but still acceptable?

With the code that Sam writes at 5:10 is my version of it still acceptable? It appears to get the same results in play

My code:

if(GetUnlockableActor() != nullptr)
    {
        UE_LOG(LogTemp, Display, TEXT("Unlocking"));
    }
    else
    {
        UE_LOG(LogTemp, Display, TEXT("Relocking"));
    }
1 Like

That is the same thing without the variable. The compiler would most likely optimise away the variable in the course so both code should be the same in the end.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms