0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 9.0.1952: Vim9: unused static field

Problem:  Vim9: unused static field
Solution: remove it and simplify code

closes: #13220

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
Yegappan Lakshmanan
2023-09-29 19:43:11 +02:00
committed by Christian Brabandt
parent 02902b547b
commit 5a05d374d3
9 changed files with 28 additions and 61 deletions

View File

@@ -220,12 +220,10 @@ add_members_to_class(
* "cl" implementing that interface.
*/
int
object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl,
int is_static)
object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl)
{
if (idx >= (is_method ? itf->class_obj_method_count
: is_static ? itf->class_class_member_count
: itf->class_obj_member_count))
: itf->class_obj_member_count))
{
siemsg("index %d out of range for interface %s", idx, itf->class_name);
return 0;
@@ -255,9 +253,7 @@ object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl,
if (searching && is_method)
// The parent class methods are stored after the current class
// methods.
method_offset += is_static
? super->class_class_function_count_child
: super->class_obj_method_count_child;
method_offset += super->class_obj_method_count_child;
}
if (i2c == NULL)
{
@@ -265,26 +261,12 @@ object_index_from_itf_index(class_T *itf, int is_method, int idx, class_T *cl,
cl->class_name, itf->class_name);
return 0;
}
if (is_static)
{
// TODO: Need a table for fast lookup?
char_u *name = itf->class_class_members[idx].ocm_name;
int m_idx = class_member_idx(i2c->i2c_class, name, 0);
if (m_idx >= 0)
return m_idx;
siemsg("class %s, interface %s, static %s not found",
cl->class_name, itf->class_name, name);
return 0;
}
else
{
// A table follows the i2c for the class
int *table = (int *)(i2c + 1);
// "method_offset" is 0, if method is in the current class. If method
// is in a parent class, then it is non-zero.
return table[idx] + method_offset;
}
// A table follows the i2c for the class
int *table = (int *)(i2c + 1);
// "method_offset" is 0, if method is in the current class. If method
// is in a parent class, then it is non-zero.
return table[idx] + method_offset;
}
/*