Quote Originally Posted by mickey View Post
my question was this!!
Sure,

and it is always a good idea to allow for inlining (hence the tips).

It is always never a good idea to duplicate code (what I gathered you wanted to do).


But I consider the "static inline" thing, not as really nice code, thus, you should check if the call itself is a problem. This is nothing we can answer without more information.

Is the small calculation you have in there the only thing? => the overhead of the function call is probably noticeable...good idea to work towards inlining.

Do you access perhaps a database? => The function call itself isn't your problem in this case, trying to have the compiler inline the function wouldn't do you any good, beside making your code uglier.

Yes they are two extremes, but both would be possible from what I have seen...


Take a look at a profiler of your choice and do an informed decision :-)