From b6a4d11c9a1f927739a1b130dfee89d9dc61f640 Mon Sep 17 00:00:00 2001 From: Kevin Day Date: Thu, 29 Mar 2012 21:23:50 -0500 Subject: [PATCH] Cleanup: only define location variable when needed Instead of defining it outside the loop, define it inside the loop and then only in the areas where it is needed. --- level_1/fl_fss/c/fss_basic.c | 6 +++--- level_1/fl_fss/c/fss_extended.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/level_1/fl_fss/c/fss_basic.c b/level_1/fl_fss/c/fss_basic.c index 8359e15..ac4a5b3 100644 --- a/level_1/fl_fss/c/fss_basic.c +++ b/level_1/fl_fss/c/fss_basic.c @@ -33,8 +33,7 @@ extern "C"{ // when handling delimits, the only time they should be applied is when a valid object would exist // however, the delimits will appear before a valid object, so remember their positions and only apply them after a would be valid object is confirmed - f_bool has_delimit = f_false; - f_string_length location = f_string_length_initialize; + f_bool has_delimit = f_false; // begin the search found->start = input->start; @@ -123,7 +122,8 @@ extern "C"{ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop) if (buffer->string[input->start] == quoted) { - location = input->start; + f_string_length location = input->start; + input->start = first_slash; if (slash_count % 2 == 0) { diff --git a/level_1/fl_fss/c/fss_extended.c b/level_1/fl_fss/c/fss_extended.c index ea05a8f..502f202 100644 --- a/level_1/fl_fss/c/fss_extended.c +++ b/level_1/fl_fss/c/fss_extended.c @@ -33,8 +33,7 @@ extern "C"{ // when handling delimits, the only time they should be applied is when a valid object would exist // however, the delimits will appear before a valid object, so remember their positions and only apply them after a would be valid object is confirmed - f_bool has_delimit = f_false; - f_string_length location = f_string_length_initialize; + f_bool has_delimit = f_false; // begin the search found->start = input->start; @@ -123,7 +122,8 @@ extern "C"{ fl_macro_fss_object_return_on_overflow((*buffer), (*input), (*found), f_unterminated_group_on_eos, f_unterminated_group_on_stop) if (buffer->string[input->start] == quoted) { - location = input->start; + f_string_length location = input->start; + input->start = first_slash; if (slash_count % 2 == 0) { -- 1.8.3.1