Avoid implicit fallthrough, by duplicating code (#4556)

The cleverness is probably not worth it.
This commit is contained in:
David Neto 2021-10-01 08:43:59 -04:00 коммит произвёл GitHub
Родитель 24476c2e32
Коммит 9529d3c2c6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -120,7 +120,8 @@ spv_result_t getWord(spv_text text, spv_position position, std::string* word) {
case '\n': case '\n':
case '\r': case '\r':
if (escaping || quoting) break; if (escaping || quoting) break;
// Fall through. word->assign(text->str + start_index, text->str + position->index);
return SPV_SUCCESS;
case '\0': { // NOTE: End of word found! case '\0': { // NOTE: End of word found!
word->assign(text->str + start_index, text->str + position->index); word->assign(text->str + start_index, text->str + position->index);
return SPV_SUCCESS; return SPV_SUCCESS;