From 74b82b688cdf75116557ba9715f850cf2a998efc Mon Sep 17 00:00:00 2001 From: Alexander Medvednikov Date: Wed, 18 Sep 2019 19:48:28 +0300 Subject: [PATCH] table: simplify find_method() --- compiler/table.v | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/compiler/table.v b/compiler/table.v index 5ada992053..1219065749 100644 --- a/compiler/table.v +++ b/compiler/table.v @@ -461,21 +461,17 @@ fn (table &Table) type_has_method(typ &Type, name string) bool { // TODO use `?Fn` fn (table &Table) find_method(typ &Type, name string) Fn { - // method := typ.find_method(name) t := table.typesmap[typ.name] - method := t.find_method(name) - for method in t.methods { if method.name == name { return method } } - if typ.parent != '' { parent := table.find_type(typ.parent) return parent.find_method(name) } - return method + return Fn{} } fn (t &Type) find_method(name string) Fn {