Switch to using `empty()` to check for emptiness.
Do not reassign variable before using it.

Swap the #ifdef to fix this.