1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

Add the Binary and Archive in the LRU cache

This commit is contained in:
Alain Magloire 2003-03-31 03:45:47 +00:00
parent 2a0331a18a
commit 5c6b6cf09d
2 changed files with 12 additions and 12 deletions

View file

@ -70,7 +70,9 @@ public Object getInfo(ICElement element) {
case ICElement.C_PROJECT: case ICElement.C_PROJECT:
return this.projectAndRootCache.get(element); return this.projectAndRootCache.get(element);
case ICElement.C_CCONTAINER: case ICElement.C_CCONTAINER:
return this.folderCache.get(element); return this.folderCache.get(element);
case ICElement.C_ARCHIVE:
case ICElement.C_BINARY:
case ICElement.C_UNIT: case ICElement.C_UNIT:
return this.fileCache.get(element); return this.fileCache.get(element);
default: default:
@ -89,6 +91,8 @@ protected Object peekAtInfo(ICElement element) {
return this.projectAndRootCache.get(element); return this.projectAndRootCache.get(element);
case ICElement.C_CCONTAINER: case ICElement.C_CCONTAINER:
return this.folderCache.get(element); return this.folderCache.get(element);
case ICElement.C_ARCHIVE:
case ICElement.C_BINARY:
case ICElement.C_UNIT: case ICElement.C_UNIT:
return this.fileCache.peek(element); return this.fileCache.peek(element);
default: default:
@ -108,6 +112,8 @@ protected void putInfo(ICElement element, Object info) {
case ICElement.C_CCONTAINER: case ICElement.C_CCONTAINER:
this.folderCache.put(element, info); this.folderCache.put(element, info);
break; break;
case ICElement.C_ARCHIVE:
case ICElement.C_BINARY:
case ICElement.C_UNIT: case ICElement.C_UNIT:
this.fileCache.put(element, info); this.fileCache.put(element, info);
break; break;
@ -127,6 +133,8 @@ protected void removeInfo(ICElement element) {
case ICElement.C_CCONTAINER: case ICElement.C_CCONTAINER:
this.folderCache.remove(element); this.folderCache.remove(element);
break; break;
case ICElement.C_ARCHIVE:
case ICElement.C_BINARY:
case ICElement.C_UNIT: case ICElement.C_UNIT:
this.fileCache.remove(element); this.fileCache.remove(element);
break; break;

View file

@ -13,11 +13,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
*/ */
public class CModelInfo extends CContainerInfo { public class CModelInfo extends CContainerInfo {
/**
* A array with all the non-java projects contained by this model
*/
Object[] nonCResources;
/** /**
* Constructs a new C Model Info * Constructs a new C Model Info
*/ */
@ -53,13 +48,10 @@ public class CModelInfo extends CContainerInfo {
* Returns an array of non-C resources contained in the receiver. * Returns an array of non-C resources contained in the receiver.
*/ */
Object[] getNonCResources() { Object[] getNonCResources() {
if (nonCResources == null) {
Object[] resources = nonCResources; nonCResources = computeNonCResources();
if (resources == null) {
resources = computeNonCResources();
nonCResources = resources;
} }
return resources; return nonCResources;
} }
} }