Quantcast

Jump to content

» «
Photo

[CLEO] proper jump method in this situation?

3 replies to this topic
nyolc8
  • nyolc8

    -

  • Members
  • Joined: 12 Oct 2009
  • None

#1

Posted 20 August 2014 - 10:40 AM

Hi all, I have a basic question, I don't really get what is the difference between these two:

:BLAH_2
//doingsomething
jump @BLAH_2

or

:BLAH_2
//doing something
jump @BLAH_3

:BLAH_3
jump @BLAH_2

So there are a lot of scripts that contains a "BLAH_3" to just jump back to "BLAH_2". Why isn't the "jump @BLAH_2" in the ":BLAH_2" itself enough? Are there even any difference? Which method is better?


Wesser
  • Wesser

    The complexity simplifier, the efficiency optimizer.

  • Feroci
  • Joined: 19 Aug 2006
  • Unknown

#2

Posted 20 August 2014 - 10:58 AM

No difference. The second snippet performs an useless GOTO as it points immediately after the command itself. The main source is full of them (compiled SWITCH control flows, particularly the last CASE/DEFAULT, suffer this code surplus), you can even find consecutive jumps. It's a fault of R* compiler which didn't optimize the code at compiling time. Do not forget to put a WAIT (preferably with 0 milliseconds) at the top of the loop for backward unconditional jumps.

Shmoopy
  • Shmoopy

    Thug (͡ ͜ʖ ͡)

  • Members
  • Joined: 16 Jun 2009
  • None

#3

Posted 20 August 2014 - 10:58 AM

The second one is not a method , its just the code that you get when you decompile the first script .

If you're looking for something similiar :

while true
wait 0
//doingsomething
end

nyolc8
  • nyolc8

    -

  • Members
  • Joined: 12 Oct 2009
  • None

#4

Posted 20 August 2014 - 11:34 AM

Thanks! :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users