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)
May 19 2024, 12:33 PM
Unknown Object (File)
Apr 29 2024, 8:54 PM
Unknown Object (File)
Apr 29 2024, 1:01 AM
Unknown Object (File)
Apr 29 2024, 12:56 AM
Unknown Object (File)
Dec 20 2023, 6:18 AM
Unknown Object (File)
Jun 28 2023, 7:58 PM
Unknown Object (File)
May 5 2023, 7:58 PM
Unknown Object (File)
Apr 7 2023, 4:18 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 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.