mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
refactor(api): remove some unnecessary HAS_KEY() (#27283)
Since keydicts are already zero-initialized, HAS_KEY() isn't needed if the zero-initialized value can satisfy some other condition.
This commit is contained in:
@@ -2153,7 +2153,6 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
|
||||
int maxwidth;
|
||||
schar_T fillchar = 0;
|
||||
int statuscol_lnum = 0;
|
||||
Window window = 0;
|
||||
|
||||
if (str.size < 2 || memcmp(str.data, "%!", 2) != 0) {
|
||||
const char *const errmsg = check_stl_option(str.data);
|
||||
@@ -2162,9 +2161,8 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
|
||||
});
|
||||
}
|
||||
|
||||
if (HAS_KEY(opts, eval_statusline, winid)) {
|
||||
window = opts->winid;
|
||||
}
|
||||
Window window = opts->winid;
|
||||
|
||||
if (HAS_KEY(opts, eval_statusline, fillchar)) {
|
||||
VALIDATE_EXP((*opts->fillchar.data != 0
|
||||
&& ((size_t)utfc_ptr2len(opts->fillchar.data) == opts->fillchar.size)),
|
||||
|
Reference in New Issue
Block a user