From f76813d8a2e4ae3204b549259fe714806807e03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Sat, 8 Dec 2018 19:29:40 +0800 Subject: =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E6=89=BElib=E7=9A=84=E4=B8=80?= =?UTF-8?q?=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/matcher/find_lib.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'server/src/matcher') diff --git a/server/src/matcher/find_lib.lua b/server/src/matcher/find_lib.lua index 3d98aef7..f24dabd4 100644 --- a/server/src/matcher/find_lib.lua +++ b/server/src/matcher/find_lib.lua @@ -179,9 +179,6 @@ local function checkParentAsObject(parentValue, name, parent) end local function checkParent(value, name, lib) - if not lib.parent then - return nil - end if name ~= value.key then return nil end @@ -214,13 +211,16 @@ end local function findLib(var, libs) local value = var.value or var for libname, lib in pairs(libs) do - local fullKey = checkSource(value, libname, lib) - if fullKey then - return lib, fullKey, false - end - local fullKey, oo = checkParent(value, libname, lib) - if fullKey then - return lib, fullKey, oo + if lib.parent then + local fullKey, oo = checkParent(value, libname, lib) + if fullKey then + return lib, fullKey, oo + end + else + local fullKey = checkSource(value, libname, lib) + if fullKey then + return lib, fullKey, false + end end end return nil, nil, nil -- cgit v1.2.3