git: usr.bin/undo: Use CMD_ITERATEALL

Tomohiro Kusumi tkusumi at crater.dragonflybsd.org
Sat Oct 10 05:46:02 PDT 2015


commit 791d7504566b349095c3ba3a505812076514fbcb
Author: Tomohiro Kusumi <kusumi.tomohiro at gmail.com>
Date:   Sun Sep 27 17:01:46 2015 +0900

    usr.bin/undo: Use CMD_ITERATEALL
    
    CMD_ITERATEALL hasn't been used although -i and -a set
    cmd to CMD_ITERATEALL. This makes doiterate() less readable.
    Change (A) to (B) to make it more readable and maintainable.
    No funcional changes.
    
    =====(A)
    if (cmd == CMD_DUMP) { ... }
    else if (RB_ROOT(&tse_tree)) { ... }
    else { fprintf(stderr, ...); }
    
    =====(B)
    switch (cmd) {
    case CMD_DUMP:
        doiterate_dump(); break;
    case CMD_ITERATEALL:
        doiterate_iterall(); break;
    }

Summary of changes:
 usr.bin/undo/undo.c | 227 ++++++++++++++++++++++++++++++++--------------------
 1 file changed, 138 insertions(+), 89 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/791d7504566b349095c3ba3a505812076514fbcb


-- 
DragonFly BSD source repository



More information about the Commits mailing list