On Wed, Aug 20, 2025 at 05:18:53PM +0800, Chao Li wrote: > If we look into the subsequent functions, yes, “isnull” will always > be assigned. But how about if someone incidentally changed a > subsequent function and moved an assignment? > I think giving an initial value is a good habit without much > performance burden.
It does not matter to leave the code as is. We have a bunch of these depending on how people feel on the day when they implement something. Compilers are smart enough to optimize such things away when they don't matter, usually. Some compiler versions and flags can also be very picky with initializations not done, missing that sometimes a variable is actually set in all the relevant code paths. Warnings can show depending on the complexity of the branches used, as well. -- Michael
signature.asc
Description: PGP signature
