Optimize grep for functions
I've got a codebase where many functions end up in _process_fn_no_sources and this dominates the run time. This optimization cuts it from ~1600s to ~70s. Output output_file.json is identical for me, but I don't have any other regression checks.
Change-Id: I76079a1c16cd29474908059ed057da559e4ad901