From 8be2be83113cbc7ae32eb2f39c991219118df046 Mon Sep 17 00:00:00 2001 From: yuyi Date: Sun, 29 Aug 2021 16:55:18 +0800 Subject: [PATCH] all: change 'if !(a in b)' to 'if a !in b' (#11330) --- cmd/tools/vcheck-md.v | 2 +- vlib/context/cancel.v | 2 +- vlib/net/html/dom.v | 2 +- vlib/v/util/module.v | 2 +- vlib/x/ttf/ttf.v | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/tools/vcheck-md.v b/cmd/tools/vcheck-md.v index 3978b48b78..b485ae15de 100644 --- a/cmd/tools/vcheck-md.v +++ b/cmd/tools/vcheck-md.v @@ -338,7 +338,7 @@ fn (mut ad AnchorData) check_link_target_match(fpath string, mut res CheckResult } } for link, anchor_lists in ad.anchors { - if !(link in checked_headlines) { + if link !in checked_headlines { if anchor_lists.len > 1 { for anchor in anchor_lists { line := match anchor { diff --git a/vlib/context/cancel.v b/vlib/context/cancel.v index 2972b17cc5..1a0ae57012 100644 --- a/vlib/context/cancel.v +++ b/vlib/context/cancel.v @@ -96,7 +96,7 @@ fn (mut ctx CancelContext) cancel(remove_from_parent bool, err IError) { } ctx.mutex.@lock() - if !(ctx.err is none) { + if ctx.err !is none { ctx.mutex.unlock() // already canceled return diff --git a/vlib/net/html/dom.v b/vlib/net/html/dom.v index f56e9c2dc3..b145ddc46b 100644 --- a/vlib/net/html/dom.v +++ b/vlib/net/html/dom.v @@ -75,7 +75,7 @@ fn (mut dom DocumentObjectModel) add_tag_attribute(tag &Tag) { fn (mut dom DocumentObjectModel) add_tag_by_type(tag &Tag) { tag_name := tag.name - if !(tag_name in dom.tag_type) { + if tag_name !in dom.tag_type { dom.tag_type[tag_name] = [tag] } else { mut temp_array := dom.tag_type[tag_name] diff --git a/vlib/v/util/module.v b/vlib/v/util/module.v index 992c594c1d..ea5eb9d9ad 100644 --- a/vlib/v/util/module.v +++ b/vlib/v/util/module.v @@ -55,7 +55,7 @@ pub fn mod_path_to_full_name(pref &pref.Preferences, mod string, path string) ?s // absolute paths instead of 'vlib' & '.vmodules' mut vmod_folders := ['vlib', '.vmodules', 'modules'] for base in pref.lookup_path.map(os.base(it)) { - if !(base in vmod_folders) { + if base !in vmod_folders { vmod_folders << base } } diff --git a/vlib/x/ttf/ttf.v b/vlib/x/ttf/ttf.v index fefa544e93..f482cc56c7 100644 --- a/vlib/x/ttf/ttf.v +++ b/vlib/x/ttf/ttf.v @@ -975,7 +975,7 @@ fn (mut tf TTF_File) create_kern_table0(vertical bool, cross bool) Kern0Table { fn (mut tf TTF_File) read_kern_table() { dprintln('*** READ KERN TABLE ***') - if !('kern' in tf.tables) { + if 'kern' !in tf.tables { return } table_offset := tf.tables['kern'].offset