poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [COMMITTED 2/2] poke/pk-cmd.c: Reduce scope of local variables


From: Jose E. Marchesi
Subject: Re: [COMMITTED 2/2] poke/pk-cmd.c: Reduce scope of local variables
Date: Sun, 03 May 2020 09:10:13 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Hi John.
OK for master.
Thanks!

    ---
     ChangeLog     |  4 ++++
     poke/pk-cmd.c | 17 +++++++++--------
     2 files changed, 13 insertions(+), 8 deletions(-)
    
    diff --git a/ChangeLog b/ChangeLog
    index c6b773fe..57c831a4 100644
    --- a/ChangeLog
    +++ b/ChangeLog
    @@ -1,3 +1,7 @@
    +2020-05-03  John Darrington <address@hidden>
    +
    +   * poke/pk-cmd.c: Reduce scope of local variables.
    +
     2020-05-03  John Darrington <address@hidden>
     
        * poke/pk-cmd.c (pk_cmd_get_next_match): Fix bug in completer.
    diff --git a/poke/pk-cmd.c b/poke/pk-cmd.c
    index 32f2d0df..ae892852 100644
    --- a/poke/pk-cmd.c
    +++ b/poke/pk-cmd.c
    @@ -158,11 +158,9 @@ static void
     pk_trie_expand_cmds (struct pk_trie *root,
                          struct pk_trie *trie)
     {
    -  size_t i;
    -  struct pk_trie *t;
    -
       if (trie->cmd != NULL)
         {
    +      struct pk_trie *t;
           t = trie->parent;
           while (t != root && t->num_children == 1)
             {
    @@ -171,11 +169,14 @@ pk_trie_expand_cmds (struct pk_trie *root,
             }
         }
       else
    -    for (i = 0; i < 256; i++)
    -      {
    -        if (trie->children[i] != NULL)
    -          pk_trie_expand_cmds (root, trie->children[i]);
    -      }
    +    {
    +      size_t i;
    +      for (i = 0; i < 256; i++)
    +   {
    +     if (trie->children[i] != NULL)
    +       pk_trie_expand_cmds (root, trie->children[i]);
    +   }
    +    }
     }
     
     static struct pk_trie *



reply via email to

[Prev in Thread] Current Thread [Next in Thread]