refactor: remove redundant char casts #15888

This commit is contained in:
dundargoc
2021-10-04 15:40:43 +02:00
committed by GitHub
parent b4c54ffa22
commit 44f7b46199
16 changed files with 38 additions and 39 deletions

View File

@@ -268,9 +268,8 @@ int encode_read_from_list(ListReaderState *const state, char *const buf, const s
|| TV_LIST_ITEM_TV(state->li)->vval.v_string != NULL);
for (size_t i = state->offset; i < state->li_length && p < buf_end; i++) {
assert(TV_LIST_ITEM_TV(state->li)->vval.v_string != NULL);
const char ch = (char)(
TV_LIST_ITEM_TV(state->li)->vval.v_string[state->offset++]);
*p++ = (char)((char)ch == (char)NL ? (char)NUL : (char)ch);
const char ch = (char)(TV_LIST_ITEM_TV(state->li)->vval.v_string[state->offset++]);
*p++ = (char)(ch == (char)NL ? (char)NUL : ch);
}
if (p < buf_end) {
state->li = TV_LIST_ITEM_NEXT(state->list, state->li);