mirror of
https://github.com/neovim/neovim.git
synced 2025-09-14 15:28:17 +00:00
vim-patch:7.4.2272
Problem: getbufinfo(), getwininfo() and gettabinfo() are inefficient.
Solution: Instead of making a copy of the variables dictionary, use a
reference.
9f8187c335
This commit is contained in:
@@ -9880,11 +9880,8 @@ static dict_T *get_buffer_info(buf_T *buf)
|
|||||||
buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
|
buf->b_ml.ml_mfp != NULL && buf->b_nwindows == 0,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
// Copy buffer variables
|
// Get a reference to buffer variables
|
||||||
dict_T *vars = dict_copy(NULL, buf->b_vars, true, 0);
|
dict_add_dict(dict, "variables", buf->b_vars);
|
||||||
if (vars != NULL) {
|
|
||||||
dict_add_dict(dict, "variables", vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy buffer options
|
// Copy buffer options
|
||||||
dict_T *opts = get_winbuf_options(true);
|
dict_T *opts = get_winbuf_options(true);
|
||||||
@@ -10806,11 +10803,8 @@ static dict_T *get_tabpage_info(tabpage_T *tp, int tp_idx)
|
|||||||
}
|
}
|
||||||
dict_add_list(dict, "windows", l);
|
dict_add_list(dict, "windows", l);
|
||||||
|
|
||||||
// Copy tabpage variables
|
// Make a reference to tabpage variables
|
||||||
dict_T *vars = dict_copy(NULL, tp->tp_vars, true, 0);
|
dict_add_dict(dict, "variables", tp->tp_vars);
|
||||||
if (vars != NULL) {
|
|
||||||
dict_add_dict(dict, "variables", vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dict;
|
return dict;
|
||||||
}
|
}
|
||||||
@@ -10910,11 +10904,8 @@ static dict_T *get_win_info(win_T *wp, short tpnr, short winnr)
|
|||||||
(bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL),
|
(bt_quickfix(wp->w_buffer) && wp->w_llist_ref != NULL),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
// Copy window variables
|
// Make a reference to window variables
|
||||||
dict_T *vars = dict_copy(NULL, wp->w_vars, true, 0);
|
dict_add_dict(dict, "variables", wp->w_vars);
|
||||||
if (vars != NULL) {
|
|
||||||
dict_add_dict(dict, "variables", vars);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Copy window options
|
// Copy window options
|
||||||
dict_T *opts = get_winbuf_options(false);
|
dict_T *opts = get_winbuf_options(false);
|
||||||
|
@@ -168,7 +168,7 @@ static int included_patches[] = {
|
|||||||
// 2275,
|
// 2275,
|
||||||
2274,
|
2274,
|
||||||
// 2273,
|
// 2273,
|
||||||
// 2272,
|
2272,
|
||||||
// 2271 NA
|
// 2271 NA
|
||||||
// 2270 NA
|
// 2270 NA
|
||||||
// 2269,
|
// 2269,
|
||||||
|
Reference in New Issue
Block a user