]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.1373: 'completeopt' checking logic can be simplified v9.1.1373
authorglepnir <glephunter@gmail.com>
Thu, 8 May 2025 21:05:10 +0000 (23:05 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 8 May 2025 21:05:10 +0000 (23:05 +0200)
Problem:  Flag checking logic uses a temporary variable and multiple
          bitwise operations in insexpand.c
Solution: Consolidate into a single equality check using bitwise OR and
          comparison (glepnir)

closes: #17276

Signed-off-by: glepnir <glephunter@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
src/insexpand.c
src/version.c

index ade7bb772bc8324c012d877a6f8605373841fb90..3839586dbb728cfc4ea382322f5cf21320d96e68 100644 (file)
@@ -805,9 +805,7 @@ cfc_has_mode(void)
     static int
 is_nearest_active(void)
 {
-    unsigned int flags = get_cot_flags();
-
-    return (flags & COT_NEAREST) && !(flags & COT_FUZZY);
+    return (get_cot_flags() & (COT_NEAREST | COT_FUZZY)) == COT_NEAREST;
 }
 
 /*
index fb1f45b53d7d31ba7bdfab0f6442e980d56b8c38..5b85a2bbdf3338083af02cf0a62b142535e90fbc 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1373,
 /**/
     1372,
 /**/