Small improvement: if a function doesn't access memory, we don't need to scan