From your code snippet I see they are pretty ok why are you asking it can be optimized further? From my working experience, very often big performance gains are not in those if-else, pointer referencing, assignment etc (although they matter if objects are huge). You can gain 50% performance gains in your choice of proper data structures and algorithms. These are very important concepts in programming. You choose it wrongly no matter how you tune your statements you are not going to get gains of 50% or even more.
You have asked a question for which I have been searching for an answer since I started programming for a living. Until today I do not think I have found the answer yet. It is like hunting for the holy grail :P
I will let other veteran C++ developers to contribute their valuable advice instead.
First; run your code through a profiler to see if you have got any performance issues. Then look at the area of the code that is indicated to have issues. i.e. Don't worry about making that code more efficient unless it is shown that you have to.
Hmm. I sorry if you feel that the advice given is lacking.
You give a struct and three small functions. It may be worth making six functions without the if(extension), that may save you something... depending on how the decision is made to set extension. Any savings will be small and may only be worth the effort if you are calling the functions a lot.
CodeMonkey's first post was a quite good advice in my opinion.
For other improvement ways, you could see if the use of restrict pointers is valid in your case.
Also, PetitCollectibleFix takes a bool* for extension. And you call it in Set and Change, giving the pointer to a variable allocated on the heap. So extension will always be not null in Fix(). If it is normal code, then you can remove the test for extension in Fix(). Or maybe that's a bug?
In the code you posted, you do a comparison in one function then call another and do the same comparison again, mine saves a bit on not 'shipping' the bool to another function and there is no need for the second comparison. It will be a little faster but not much...not noticeable unless you are calling the functions a vast number of times.