public SourceFile retrievePanSource ( String name , List < String > loadpath ) { String cacheKey = name + ( ( String ) " " ) + String . join ( ":" , loadpath ) ; SourceFile cachedResult = retrievePanCacheLoadpath . get ( cacheKey ) ; if ( cachedResult == null ) { File file = lookupSource ( name , loadpath ) ; cachedResult = createPanSourceFile ( name , file ) ; retrievePanCacheLoadpath . put ( cacheKey , cachedResult ) ; } return cachedResult ; }
Optimised due to lots of calls and slow lookupSource