f_array_length_t newline_last = range->start;
f_array_length_t slash_first = 0;
f_array_length_t slash_count = 0;
- f_array_length_t start = 0;
+ f_array_length_t comment_start = 0;
// Identify where the content ends.
while (range->start <= range->stop && range->start < buffer.used) {
if (buffer.string[range->start] == f_fss_comment_s.string[0]) {
// The newline_last is initialized to the range->start, which may not actually be a new line.
- if (buffer.string[newline_last] == f_string_eol_s.string[0]) {
- start = newline_last + 1;
- }
- else {
- start = newline_last;
- }
+ comment_start = (buffer.string[newline_last] == f_string_eol_s.string[0]) ? newline_last + 1 : newline_last;
status = f_fss_seek_to_eol(state, buffer, range);
if (F_status_is_error(status)) break;
- status = f_string_ranges_increase(state.step_small, comments);
- if (F_status_is_error(status)) break;
-
if (range->start > range->stop || range->start >= buffer.used) {
--range->start;
}
newline_last = range->start;
}
- comments->array[comments->used].start = start;
+ status = f_string_ranges_increase(state.step_small, comments);
+ if (F_status_is_error(status)) break;
+
+ comments->array[comments->used].start = comment_start;
comments->array[comments->used++].stop = range->start++;
continue;