Using Self as a Method Default

BlitzMax Forums/BlitzMax Programming/Using Self as a Method Default

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If you are curious about speed, try this, the method I posted above.

I have to admit that I'm curious if it's any faster than an if myself

...reposting:
Method Sample(a:blah, b:blah = null)
     self.ni = (self.n * Not(b)) + b.n + a.n
End Method


If b isn't passed in, the expression evaluates to
self.ni = self.n * 1 + 0 + a.n

if b is passed in it evaluates to
self.ni = self.n * 0 + b.n + a.n