Logically, this does not make any difference, and "weird memory behaviour" isn't happening because of that. You get a minor memory optimisation out of not allocating a variable every time, you get a minor computational optimisation out of not querying the capital region every time, but both are so miniscule that they are not worth the increased code complexity, in my opinion (this goes in general for the "declare all variables at the beginning of the method" pattern the Civ4 source loves so much). On top of that, it's very likely the compiler will already make those optimisations for you, regardless of what the source looks like, although I am not nearly as well informed enough on C++ to say for sure.