mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +02:00
Patch for David Daoust.
Fixes BaseScanner#fileCache.
This commit is contained in:
parent
33390e2e03
commit
3615ece8be
1 changed files with 7 additions and 5 deletions
|
@ -2738,18 +2738,20 @@ abstract class BaseScanner implements IScanner {
|
||||||
private CodeReader createReader(String path, String fileName)
|
private CodeReader createReader(String path, String fileName)
|
||||||
{
|
{
|
||||||
String finalPath = ScannerUtility.createReconciledPath(path, fileName);
|
String finalPath = ScannerUtility.createReconciledPath(path, fileName);
|
||||||
CodeReader reader = (CodeReader) fileCache.get(finalPath.toCharArray());
|
char [] finalPathc = finalPath.toCharArray();
|
||||||
if (reader != null)
|
CodeReader reader = (CodeReader) fileCache.get(finalPathc);
|
||||||
|
if (reader != null)
|
||||||
return reader; // found the file in the cache
|
return reader; // found the file in the cache
|
||||||
|
|
||||||
// create a new reader on this file (if the file does not exist we will get null)
|
// create a new reader on this file (if the file does not exist we will get null)
|
||||||
reader = createReaderDuple(finalPath);
|
reader = createReaderDuple(finalPath);
|
||||||
if (reader == null)
|
if (reader == null)
|
||||||
return null; // the file was not found
|
return null; // the file was not found
|
||||||
|
|
||||||
if (reader.filename != null)
|
if (reader.filename != null)
|
||||||
fileCache.put(reader.filename, reader);
|
// put the full requested path in the cache -- it is more likely
|
||||||
|
// to match next time than the reader.filename
|
||||||
|
fileCache.put(finalPathc, reader);
|
||||||
return reader;
|
return reader;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue