1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +02:00

2005-03-29 Chris Wiebe

small change for potential reduction in memory usage
	* browser/org/eclipse/cdt/core/browser/QualifiedTypeName.java
This commit is contained in:
Chris Wiebe 2005-03-30 00:46:55 +00:00
parent 6acaa7fee9
commit 12aaa62fa7
2 changed files with 11 additions and 3 deletions

View file

@ -1,4 +1,8 @@
2005-03-9 Chris Wiebe
2005-03-29 Chris Wiebe
small change for potential reduction in memory usage
* browser/org/eclipse/cdt/core/browser/QualifiedTypeName.java
2005-03-29 Chris Wiebe
temporary fix for type parser timeout
* browser/org/eclipse/cdt/core/browser/cache/TypeParser.java

View file

@ -71,13 +71,17 @@ public class QualifiedTypeName implements IQualifiedTypeName {
lastIndex = 0;
qualifierIndex = qualifiedName.indexOf(QUALIFIER, 0);
while (qualifierIndex >= 0) {
segments[segmentCount] = qualifiedName.substring(lastIndex, qualifierIndex);
// note: we allocate a new string rather than use the returned substring,
// otherwise we're holding a reference to the entire original string
segments[segmentCount] = new String(qualifiedName.substring(lastIndex, qualifierIndex));
++segmentCount;
lastIndex = qualifierIndex + QUALIFIER.length();
qualifierIndex = qualifiedName.indexOf(QUALIFIER, lastIndex);
}
Assert.isTrue(segmentCount == (maxSegments - 1));
segments[segmentCount] = qualifiedName.substring(lastIndex);
// note: we allocate a new string rather than use the returned substring,
// otherwise we're holding a reference to the entire original string
segments[segmentCount] = new String(qualifiedName.substring(lastIndex));
}
return segments;
}