What to put in empty if statement?

The short story is I need to allow an if statement to be empty. Since SublimeKSP gives me an error when an if statement is empty, I need to put something in there to satisfy it. I could declare a dummy variable and write to it, but I don't want to declare anything extraneous like that. What is a good fast, low memory instruction I can put in my empty if statement?
Best Answer
-
You can always do an i = i thing as a sort of a no-op. But with this sKSP option disabled you don't have to do anything, just leave the branch empty.
0
Answers
-
There's an option in SublimeKSP not to warn on empty if/case statements.
0 -
Very cool, I did not know about that. Thanks
SublimeKSP's warning says that an empty if statement is equivalent to invoking the "exit" function. I haven't used the exit function personally yet, but the manual says it exits functions or callbacks. There's a good chance that I don't want to do that either. If that is the case, then do I have any other recourse than to put a filler statement in my otherwise empty if statement?
0 -
You can always do an i = i thing as a sort of a no-op. But with this sKSP option disabled you don't have to do anything, just leave the branch empty.
0
Categories
- 10.5K All Categories
- 20 Welcome
- 440 Hangout
- 58 NI News
- 202 Tech Talks
- 1K Native Access
- 4.8K Komplete
- 608 Komplete General
- 1.1K Komplete Kontrol
- 1.8K Kontakt
- 471 Reaktor
- 149 Battery 4
- 267 Guitar Rig & FX
- 198 Massive X & Synths
- 206 Other Software & Hardware
- 2.2K Maschine
- 14 Sampling Room
- 2.6K Traktor
- 2.3K Traktor Software & Hardware
- Check out everything you can do
- Create an account
- See member benefits
- Answer questions
- Ask the community
- See product news
- Connect with creators