Page MenuHomeFreeBSD

ext2fs: Tidy ups for variable assignment.
ClosedPublic

Authored by pfg on Feb 4 2018, 3:19 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 17, 10:40 AM
Unknown Object (File)
Sun, Dec 8, 3:46 PM
Unknown Object (File)
Nov 19 2024, 10:38 AM
Unknown Object (File)
Oct 14 2024, 5:58 AM
Unknown Object (File)
Sep 30 2024, 11:06 PM
Unknown Object (File)
Sep 23 2024, 7:24 PM
Unknown Object (File)
Sep 22 2024, 10:13 PM
Unknown Object (File)
Sep 17 2024, 9:17 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

I am more prefer to initialize stack variables immediately after declaration, but, seems like it is not so perfect practice.
Ok.

This revision is now accepted and ready to land.Feb 5 2018, 7:53 AM
In D14193#297843, @fsu wrote:

I am more prefer to initialize stack variables immediately after declaration, but, seems like it is not so perfect practice.
Ok.

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.

This revision was automatically updated to reflect the committed changes.