Question about return's and else's

Ashlebede

New Member
Reaction score
43
Random question... is one of the following more efficient than the other one?

JASS:
function foo takes nothing returns nothing
    if /*condition*/ then
        //! if actions
        return /****this line****/
    endif
        //! else actions
endfunction


JASS:
function foo takes nothing returns nothing
    if /*condition*/ then
        //! if actions
    else
        //! else actions
    endif
endfunction


Just out of curiosity. Considering I also have many many [ljass]elseif[/ljass]'s in the same function.
 

saw792

Is known to say things. That is all.
Reaction score
280
If you're that interested, benchmark it. At a random guess based on very little evidence and absolutely zero interest, the first example may be faster.
 

Lyerae

I keep popping up on this site from time to time.
Reaction score
105
I'm personally not a fan of the template; I prefer to write it myself.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top