patch 8.2.4683: verbose check with dict_find() to see if a key is present
Problem: Verbose check with dict_find() to see if a key is present.
Solution: Add dict_has_key(). (Yegappan Lakshmanan, closes #10074)
diff --git a/src/highlight.c b/src/highlight.c
index 6add298..724c4ba 100644
--- a/src/highlight.c
+++ b/src/highlight.c
@@ -718,7 +718,7 @@
# ifdef FEAT_BEVAL_TIP
gui_init_tooltip_font();
# endif
-# if defined(FEAT_MENU) && (defined(FEAT_GUI_ATHENA) || defined(FEAT_GUI_MOTIF))
+# if defined(FEAT_MENU) && defined(FEAT_GUI_MOTIF)
gui_init_menu_font();
# endif
}
@@ -2134,7 +2134,7 @@
|| do_menu
# endif
# ifdef FEAT_BEVAL_TIP
- // In Athena & Motif, the Tooltip highlight group is always a fontset
+ // In Motif, the Tooltip highlight group is always a fontset
|| do_tooltip
# endif
)
@@ -2156,7 +2156,7 @@
// fontset. Same for the Menu group.
if (do_normal)
gui_init_font(arg, TRUE);
-# if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
+# if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
if (do_menu)
{
# ifdef FONTSET_ALWAYS
@@ -2170,7 +2170,7 @@
# ifdef FEAT_BEVAL_GUI
if (do_tooltip)
{
- // The Athena widget set cannot currently handle switching between
+ // The Athena widget set could not handle switching between
// displaying a single font and a fontset.
// If the XtNinternational resource is set to True at widget
// creation, then a fontset is always used, otherwise an
@@ -2194,7 +2194,7 @@
if (do_normal)
gui_init_font(arg, FALSE);
#ifndef FONTSET_ALWAYS
-# if (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) && defined(FEAT_MENU)
+# if defined(FEAT_GUI_MOTIF) && defined(FEAT_MENU)
if (do_menu)
{
gui.menu_font = HL_TABLE()[idx].sg_font;
@@ -4411,7 +4411,7 @@
if (dict_get_bool(dict, (char_u *)"default", VVAL_FALSE) == VVAL_TRUE)
dodefault = TRUE;
- if (dict_find(dict, (char_u *)"cleared", -1) != NULL)
+ if (dict_has_key(dict, "cleared"))
{
varnumber_T cleared;
@@ -4425,7 +4425,7 @@
}
}
- if (dict_find(dict, (char_u *)"linksto", -1) != NULL)
+ if (dict_has_key(dict, "linksto"))
{
char_u *linksto;