From 1a555ab89836fcd728d743995b44b8fb3b36f1a5 Mon Sep 17 00:00:00 2001 From: Enzo Date: Mon, 9 Aug 2021 06:39:15 +0200 Subject: [PATCH] v.gen.c: fix generation for `string.index` (#11106) --- vlib/v/gen/c/array.v | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vlib/v/gen/c/array.v b/vlib/v/gen/c/array.v index aa46b50244..57a838cbfd 100644 --- a/vlib/v/gen/c/array.v +++ b/vlib/v/gen/c/array.v @@ -526,7 +526,7 @@ fn (mut g Gen) gen_array_index_method(left_type ast.Type) string { fn_builder.writeln('\t$elem_type_str* pelem = a.data;') fn_builder.writeln('\tfor (int i = 0; i < a.len; ++i, ++pelem) {') if elem_sym.kind == .string { - fn_builder.writeln('\t\tif (fast_string_eq(( *pelem, v))) {') + fn_builder.writeln('\t\tif (fast_string_eq(*pelem, v)) {') } else if elem_sym.kind == .array && !info.elem_type.is_ptr() { ptr_typ := g.gen_array_equality_fn(info.elem_type) fn_builder.writeln('\t\tif (${ptr_typ}_arr_eq( *pelem, v)) {')