Improved performance for nested rules, avoiding to iterate
for maps with no rules.