Reuse variable or local variables?

Is there any difference that we know of regarding optimization if we reuse variables on the stack or make them local inside a block?

Little example:

var bb: u64 = undefined;
if (this) {
    bb = 42;
    // do things with bb
}
if (that) {
    bb = 43;
    // do things with bb
}

or

if (this) {
    var bb: u64 = 42;
    // do things with bb
}
if (that) {
    var bb: u64 = 43;
    // do things with bb
}

In my case there are like 5 of these variables I absolutely need. Wondering what the compiler makes of it in complicated cases.

1 Like

Compile it and find out!

But I would guess they would be identical.