Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Wiebe2004-08-26 20:45:24 +0000
committerChris Wiebe2004-08-26 20:45:24 +0000
commite47e1cf94a9ffe49a12503360da840a025820d98 (patch)
tree61ec6fa4d99569b7d93c42a29d9a0611ead08b0d
parent45adcaed84014c8f840814f3765edc211d7d0ef9 (diff)
downloadorg.eclipse.cdt-e47e1cf94a9ffe49a12503360da840a025820d98.tar.gz
org.eclipse.cdt-e47e1cf94a9ffe49a12503360da840a025820d98.tar.xz
org.eclipse.cdt-e47e1cf94a9ffe49a12503360da840a025820d98.zip
2004-08-26 Chris Wiebe
slight reduction in memory allocations * browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.hava * src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
-rw-r--r--core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java7
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java8
2 files changed, 6 insertions, 9 deletions
diff --git a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java
index 307026dc965..834a7f596be 100644
--- a/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java
+++ b/core/org.eclipse.cdt.ui/browser/org/eclipse/cdt/ui/browser/typeinfo/TypeSelectionDialog.java
@@ -141,8 +141,7 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
private boolean matchQualifiedName(ITypeInfo info) {
IQualifiedTypeName qualifiedName = info.getQualifiedTypeName();
- String[] segments = qualifiedName.segments();
- if (fSegmentMatchers.length != segments.length)
+ if (fSegmentMatchers.length != qualifiedName.segmentCount())
return false;
if (fMatchGlobalNamespace) {
@@ -152,10 +151,10 @@ public class TypeSelectionDialog extends TwoPaneElementSelector {
}
boolean matchFound = true;
- int max = Math.min(fSegmentMatchers.length, segments.length);
+ int max = Math.min(fSegmentMatchers.length, qualifiedName.segmentCount());
for (int i = 0; i < max; ++i) {
StringMatcher matcher = fSegmentMatchers[i];
- String name = segments[i];
+ String name = qualifiedName.segment(i);
if (name == null || !matcher.match(name)) {
matchFound = false;
break;
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
index 13b968e21f4..51989e35481 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
@@ -267,10 +267,9 @@ public class NewClassCodeGenerator {
return insertPos;
}
private void beginNamespace(StringBuffer text) {
- String[] segments = fNamespace.segments();
- for (int i = 0; i < segments.length; ++i) {
+ for (int i = 0; i < fNamespace.segmentCount(); ++i) {
text.append("namespace "); //$NON-NLS-1$
- text.append(segments[i]);
+ text.append(fNamespace.segment(i));
text.append(fLineDelimiter);
text.append('{');
text.append(fLineDelimiter);
@@ -279,8 +278,7 @@ public class NewClassCodeGenerator {
}
private void endNamespace(StringBuffer text) {
- String[] segments = fNamespace.segments();
- for (int i = 0; i < segments.length; ++i) {
+ for (int i = 0; i < fNamespace.segmentCount(); ++i) {
text.append(fLineDelimiter);
text.append("};"); //$NON-NLS-1$
text.append(fLineDelimiter);

Back to the top