1
0
forked from aniani/vim

patch 9.0.1895: Vim9: finding object method/member is inefficient

Problem:  Vim9: finding method/member is inefficient
Solution: Use lookups

closes: #13073

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
This commit is contained in:
Ernie Rael
2023-09-11 19:54:42 +02:00
committed by Christian Brabandt
parent f787ee8451
commit 4d00b835c4
4 changed files with 103 additions and 65 deletions

View File

@@ -394,10 +394,10 @@ compile_class_object_index(cctx_T *cctx, char_u **arg, type_T *type)
if (type->tt_type == VAR_OBJECT)
{
int m_idx = object_member_idx(cl, name, len);
int m_idx;
ocmember_T *m = object_member_lookup(cl, name, len, &m_idx);
if (m_idx >= 0)
{
ocmember_T *m = &cl->class_obj_members[m_idx];
if (*name == '_' && !inside_class(cctx, cl))
{
semsg(_(e_cannot_access_private_member_str), m->ocm_name);