Implemented caching in code scanner