git: objformat(1): Simplify cmds handling code

Aaron LI aly at crater.dragonflybsd.org
Tue Sep 23 23:23:45 PDT 2025


commit e4e212689f7786667e81a2608f551a2943908b42
Author: Aaron LI <aly at aaronly.me>
Date:   Tue Sep 23 12:47:45 2025 +0800

    objformat(1): Simplify cmds handling code
    
    * Set 'cmd=NULL' for the last cmds element, and the loop until it,
      avoiding the NELEM() macro and <sys/param.h> inclusion.
    
    * The 'cmds' variable cannot be NULL, so remove the unnecessary 'if'
      tests.

Summary of changes:
 usr.bin/objformat/objformat.c | 78 +++++++++++++++++++------------------------
 1 file changed, 34 insertions(+), 44 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/e4e212689f7786667e81a2608f551a2943908b42


-- 
DragonFly BSD source repository


More information about the Commits mailing list