perf(kernel/metavar): performance problem with occurs method

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>