diff src/if_py_both.h @ 20392:4c317d8c1051 v8.2.0751

patch 8.2.0751: Vim9: performance can be improved Commit: https://github.com/vim/vim/commit/7e9f351b2e69b498c4ee5004d7459844e1ba191a Author: Bram Moolenaar <Bram@vim.org> Date: Wed May 13 22:44:22 2020 +0200 patch 8.2.0751: Vim9: performance can be improved Problem: Vim9: performance can be improved. Solution: Don't call break. Inline check for list materialize. Make an inline version of ga_grow().
author Bram Moolenaar <Bram@vim.org>
date Wed, 13 May 2020 22:45:04 +0200
parents 6e1e4d7a7b39
children d571231175b4
line wrap: on
line diff
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -785,7 +785,7 @@ VimToPython(typval_T *our_tv, int depth,
 	    return NULL;
 	}
 
-	range_list_materialize(list);
+	CHECK_LIST_MATERIALIZE(list);
 	FOR_ALL_LIST_ITEMS(list, curr)
 	{
 	    if (!(newObj = VimToPython(&curr->li_tv, depth + 1, lookup_dict)))
@@ -2256,7 +2256,7 @@ ListNew(PyTypeObject *subtype, list_T *l
 	return NULL;
     self->list = list;
     ++list->lv_refcount;
-    range_list_materialize(list);
+    CHECK_LIST_MATERIALIZE(list);
 
     pyll_add((PyObject *)(self), &self->ref, &lastlist);
 
@@ -2824,7 +2824,7 @@ ListIter(ListObject *self)
 	return NULL;
     }
 
-    range_list_materialize(l);
+    CHECK_LIST_MATERIALIZE(l);
     list_add_watch(l, &lii->lw);
     lii->lw.lw_item = l->lv_first;
     lii->list = l;
@@ -3021,7 +3021,7 @@ FunctionConstructor(PyTypeObject *subtyp
 		return NULL;
 	    }
 	    argslist = argstv.vval.v_list;
-	    range_list_materialize(argslist);
+	    CHECK_LIST_MATERIALIZE(argslist);
 
 	    argc = argslist->lv_len;
 	    if (argc != 0)