mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
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
This commit is contained in:
parent
45adcaed84
commit
e47e1cf94a
2 changed files with 6 additions and 9 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue