Improve performance (don't filter ALL_MODULES)

It turns out that this single line was responsible for 28-44% of the
time we spent parsing makefiles. So instead of filtering across
$(ALL_MODULES), check to see if a variable that we always would set is
set.

Test: treehugger
Test: check kati-build eval time before/after
Change-Id: I946c2efd060181a4ae9edd3409c53d9b49a58285
diff --git a/core/base_rules.mk b/core/base_rules.mk
index e3f8a70..511dda5 100644
--- a/core/base_rules.mk
+++ b/core/base_rules.mk
@@ -748,7 +748,7 @@
 ## Register with ALL_MODULES
 ###########################################################
 
-ifeq ($(filter $(my_register_name),$(ALL_MODULES)),)
+ifndef ALL_MODULES.$(my_register_name).PATH
     # These keys are no longer used, they've been replaced by keys that specify
     # target/host/host_cross (REQUIRED_FROM_TARGET / REQUIRED_FROM_HOST) and similar.
     #