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, Nov 25, 3:57 AM
Unknown Object (File)
Mon, Nov 24, 12:09 AM
Unknown Object (File)
Fri, Nov 21, 1:34 AM
Unknown Object (File)
Fri, Nov 21, 1:23 AM
Unknown Object (File)
Fri, Nov 21, 1:20 AM
Unknown Object (File)
Fri, Nov 21, 1:17 AM
Unknown Object (File)
Fri, Nov 21, 1:14 AM
Unknown Object (File)
Sun, Nov 16, 11:47 PM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 14773
Build 14892: arc lint + arc unit

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.