Remove dead code in token enumerator
authorTobias Brunner <tobias@strongswan.org>
Wed, 27 Mar 2013 15:15:10 +0000 (16:15 +0100)
committerTobias Brunner <tobias@strongswan.org>
Tue, 11 Jun 2013 09:03:12 +0000 (11:03 +0200)
Since we always search for the nearest separator (and strip them from
the front of the next token) there can't be any separators left at the
end of a token.

src/libstrongswan/collections/enumerator.c

index f80cdab..8049ac0 100644 (file)
@@ -264,7 +264,7 @@ static bool enumerate_token_enum(token_enum_t *this, char **token)
                }
        }
 
-       /* trim trailing characters/separators */
+       /* trim trailing characters */
        pos--;
        while (pos >= *token)
        {
@@ -278,17 +278,7 @@ static bool enumerate_token_enum(token_enum_t *this, char **token)
                        }
                        trim++;
                }
-               sep = this->sep;
-               while (*sep)
-               {
-                       if (*sep == *pos)
-                       {
-                               *(pos--) = '\0';
-                               break;
-                       }
-                       sep++;
-               }
-               if (!*trim && !*sep)
+               if (!*trim)
                {
                        break;
                }