Skip to content

Commit

Permalink
fix(PVS/V560): part of conditional expression is always true/false
Browse files Browse the repository at this point in the history
  • Loading branch information
dundargoc committed Nov 21, 2022
1 parent 5c0b017 commit b316ac6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/nvim/api/win_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ static void parse_border_title(Object title, Object title_pos, FloatConfig *fcon
return;
}

if (title.type == kObjectTypeArray && title.data.array.size == 0) {
if (title.data.array.size == 0) {
api_set_error(err, kErrorTypeValidation, "title cannot be an empty array");
return;
}
Expand All @@ -391,7 +391,6 @@ static void parse_border_title(Object title, Object title_pos, FloatConfig *fcon
fconfig->title_chunks = parse_virt_text(title.data.array, err, &fconfig->title_width);

fconfig->title = true;
return;
}

static bool parse_title_pos(Object title_pos, FloatConfig *fconfig, Error *err)
Expand Down
2 changes: 1 addition & 1 deletion src/nvim/quickfix.c
Original file line number Diff line number Diff line change
Expand Up @@ -6711,7 +6711,7 @@ static bool mark_quickfix_ctx(qf_info_T *qi, int copyID)
typval_T *ctx = qi->qf_lists[i].qf_ctx;
if (ctx != NULL && ctx->v_type != VAR_NUMBER
&& ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT) {
abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL);
abort = set_ref_in_item(ctx, copyID, NULL, NULL);
}

Callback *cb = &qi->qf_lists[i].qf_qftf_cb;
Expand Down

0 comments on commit b316ac6

Please sign in to comment.