Initialize variables only when needed: this way if we return early for
whatever reason we don't was time with unneeded assignments. It also makes
easier to understand wahat is happening without looking back if the
variables were properly initialized.
Details
Details
- Reviewers
fsu - Commits
- rS328882: ext2fs: Cleanup variable assignments for extents.
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
I am more prefer to initialize stack variables immediately after declaration, but, seems like it is not so perfect practice.
Ok.
Comment Actions
That used to be a regular practice some years (or decades) ago but compilers have become very good at detecting when values are not initialized so it is done this way now.