1
0
forked from aniani/vim

patch 9.1.0828: string_T struct could be used more often

Problem:  string_T struct could be used more often
Solution: Refactor code and make use of string_T struct
          for key-value pairs, reformat overlong lines
          (John Marriott)

closes: #15975

Signed-off-by: John Marriott <basilisk@internode.on.net>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
John Marriott
2024-11-02 15:59:01 +01:00
committed by Christian Brabandt
parent f1d83c4c71
commit 8d4477ef22
9 changed files with 76 additions and 55 deletions

View File

@@ -265,8 +265,8 @@ get_char_class(char_u **pp)
static keyvalue_T *last_entry = NULL;
target.key = 0;
target.value = (char *)*pp + 2;
target.length = 0; // not used, see cmp_keyvalue_value_n()
target.value.string = *pp + 2;
target.value.length = 0; // not used, see cmp_keyvalue_value_n()
if (last_entry != NULL && cmp_keyvalue_value_n(&target, last_entry) == 0)
entry = last_entry;
@@ -277,7 +277,7 @@ get_char_class(char_u **pp)
if (entry != NULL)
{
last_entry = entry;
*pp += entry->length + 2;
*pp += entry->value.length + 2;
return entry->key;
}
}