Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21100

Casting For Optimization

$
0
0
I created a Nintendo emulator in vb6 and currently heavily optimizing it. But have question. Im basically treating vb6 like vb.net having Option Strict On by using a lot of casting only where they are needed, such as CLng, CSng, etc.. If Im storing a formula into a variable where the formula contains another variable of a different data type, should I just cast that variable, or the entire formula? Which method is the fastest or better? An example would be this:

Code:

Dim lTest As Long
Dim bTest As Byte
....
....
lTest = &HFFFF& + CLng(bTest) * 256

or

 lTest = CLng(&HFFFF& + bTest * 256)

:bigyello:
Thanks in advance

Viewing all articles
Browse latest Browse all 21100

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>