mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 18:26:01 +02:00
Add the Binary and Archive in the LRU cache
This commit is contained in:
parent
2a0331a18a
commit
5c6b6cf09d
2 changed files with 12 additions and 12 deletions
|
@ -71,6 +71,8 @@ public Object getInfo(ICElement element) {
|
|||
return this.projectAndRootCache.get(element);
|
||||
case ICElement.C_CCONTAINER:
|
||||
return this.folderCache.get(element);
|
||||
case ICElement.C_ARCHIVE:
|
||||
case ICElement.C_BINARY:
|
||||
case ICElement.C_UNIT:
|
||||
return this.fileCache.get(element);
|
||||
default:
|
||||
|
@ -89,6 +91,8 @@ protected Object peekAtInfo(ICElement element) {
|
|||
return this.projectAndRootCache.get(element);
|
||||
case ICElement.C_CCONTAINER:
|
||||
return this.folderCache.get(element);
|
||||
case ICElement.C_ARCHIVE:
|
||||
case ICElement.C_BINARY:
|
||||
case ICElement.C_UNIT:
|
||||
return this.fileCache.peek(element);
|
||||
default:
|
||||
|
@ -108,6 +112,8 @@ protected void putInfo(ICElement element, Object info) {
|
|||
case ICElement.C_CCONTAINER:
|
||||
this.folderCache.put(element, info);
|
||||
break;
|
||||
case ICElement.C_ARCHIVE:
|
||||
case ICElement.C_BINARY:
|
||||
case ICElement.C_UNIT:
|
||||
this.fileCache.put(element, info);
|
||||
break;
|
||||
|
@ -127,6 +133,8 @@ protected void removeInfo(ICElement element) {
|
|||
case ICElement.C_CCONTAINER:
|
||||
this.folderCache.remove(element);
|
||||
break;
|
||||
case ICElement.C_ARCHIVE:
|
||||
case ICElement.C_BINARY:
|
||||
case ICElement.C_UNIT:
|
||||
this.fileCache.remove(element);
|
||||
break;
|
||||
|
|
|
@ -13,11 +13,6 @@ import org.eclipse.core.resources.ResourcesPlugin;
|
|||
*/
|
||||
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
|
||||
*/
|
||||
|
@ -53,13 +48,10 @@ public class CModelInfo extends CContainerInfo {
|
|||
* Returns an array of non-C resources contained in the receiver.
|
||||
*/
|
||||
Object[] getNonCResources() {
|
||||
|
||||
Object[] resources = nonCResources;
|
||||
if (resources == null) {
|
||||
resources = computeNonCResources();
|
||||
nonCResources = resources;
|
||||
if (nonCResources == null) {
|
||||
nonCResources = computeNonCResources();
|
||||
}
|
||||
return resources;
|
||||
return nonCResources;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue