comparison src/map.c @ 29175:755ab148288b v8.2.5107

patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Commit: https://github.com/vim/vim/commit/93a1096fe48e12095544924adb267e3b8a16b221 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jun 16 11:42:09 2022 +0100 patch 8.2.5107: some callers of rettv_list_alloc() check for not OK Problem: Some callers of rettv_list_alloc() check for not OK. (Christ van Willegen) Solution: Use "==" instead of "!=" when checking the return value.
author Bram Moolenaar <Bram@vim.org>
date Thu, 16 Jun 2022 12:45:03 +0200
parents 1ec1ba7e7728
children 35a30cb18005
comparison
equal deleted inserted replaced
29174:a13f0046b5ef 29175:755ab148288b
2377 else 2377 else
2378 rettv->vval.v_string = str2special_save(rhs, FALSE); 2378 rettv->vval.v_string = str2special_save(rhs, FALSE);
2379 } 2379 }
2380 2380
2381 } 2381 }
2382 else if (rettv_dict_alloc(rettv) != FAIL && rhs != NULL) 2382 else if (rettv_dict_alloc(rettv) == OK && rhs != NULL)
2383 mapblock2dict(mp, rettv->vval.v_dict, 2383 mapblock2dict(mp, rettv->vval.v_dict,
2384 did_simplify ? keys_simplified : NULL, 2384 did_simplify ? keys_simplified : NULL,
2385 buffer_local, abbr); 2385 buffer_local, abbr);
2386 2386
2387 vim_free(keys_buf); 2387 vim_free(keys_buf);
2407 if (in_vim9script() && check_for_opt_bool_arg(argvars, 0) == FAIL) 2407 if (in_vim9script() && check_for_opt_bool_arg(argvars, 0) == FAIL)
2408 return; 2408 return;
2409 if (argvars[0].v_type != VAR_UNKNOWN) 2409 if (argvars[0].v_type != VAR_UNKNOWN)
2410 abbr = tv_get_bool(&argvars[0]); 2410 abbr = tv_get_bool(&argvars[0]);
2411 2411
2412 if (rettv_list_alloc(rettv) != OK) 2412 if (rettv_list_alloc(rettv) == FAIL)
2413 return; 2413 return;
2414 2414
2415 validate_maphash(); 2415 validate_maphash();
2416 2416
2417 // Do it twice: once for global maps and once for local maps. 2417 // Do it twice: once for global maps and once for local maps.