From 546e89f611ac6ef10820ed302ba4e2796ce9263a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 7 Aug 2013 13:44:51 +0400 Subject: [PATCH] (vfs_path_tokens_get): minor refactoring: replace while() by for(). Signed-off-by: Andrew Borodin --- lib/vfs/path.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/vfs/path.c b/lib/vfs/path.c index 8ceaf9bc6..7e69b49bc 100644 --- a/lib/vfs/path.c +++ b/lib/vfs/path.c @@ -1408,9 +1408,9 @@ vfs_path_tokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t l g_string_assign (element_tokens, ""); element = vfs_path_get_by_index (vpath, element_index); - path_tokens = iterator = g_strsplit (element->path, PATH_SEP_STR, -1); + path_tokens = g_strsplit (element->path, PATH_SEP_STR, -1); - while (*iterator != NULL) + for (iterator = path_tokens; *iterator != NULL; iterator++) { if (**iterator != '\0') { @@ -1431,7 +1431,6 @@ vfs_path_tokens_get (const vfs_path_t * vpath, ssize_t start_position, ssize_t l else start_position--; } - iterator++; } g_strfreev (path_tokens); vfs_path_tokens_add_class_info (element, ret_tokens, element_tokens);