1
0
Fork 0

Patch from Julian Foad:

Use getDisplayName instead of duplicated code.
Replace unnecessary node lookups by name with direct access.
This commit is contained in:
david 2002-07-31 16:45:35 +00:00
parent 1d82339fd8
commit 2a1ef0621e
2 changed files with 4 additions and 18 deletions

View file

@ -178,12 +178,7 @@ void HttpdChannel::foundTerminator (void) {
for (int i = 0; i < node->nChildren(); i++) { for (int i = 0; i < node->nChildren(); i++) {
SGPropertyNode *child = node->getChild(i); SGPropertyNode *child = node->getChild(i);
string name = child->getName(); string name = child->getDisplayName(true);
if ( node->getChild(name.c_str(), 1) ) {
char buf[16];
sprintf(buf, "[%d]", child->getIndex());
name += buf;
}
string line = ""; string line = "";
if ( child->nChildren() > 0 ) { if ( child->nChildren() > 0 ) {
line += "<B><A HREF=\""; line += "<B><A HREF=\"";

View file

@ -201,15 +201,7 @@ TelnetChannel::foundTerminator()
for (int i = 0; i < dir->nChildren(); i++) for (int i = 0; i < dir->nChildren(); i++)
{ {
SGPropertyNode * child = dir->getChild(i); SGPropertyNode * child = dir->getChild(i);
string name = child->getName(); string line = child->getDisplayName(true);
string line = name;
if (dir->getChild( name.c_str(), 1 ))
{
char buf[16];
sprintf(buf, "[%d]", child->getIndex());
line += buf;
}
if ( child->nChildren() > 0 ) if ( child->nChildren() > 0 )
{ {
@ -219,10 +211,9 @@ TelnetChannel::foundTerminator()
{ {
if (mode == PROMPT) if (mode == PROMPT)
{ {
string value = dir->getStringValue( name.c_str(), "" ); string value = child->getStringValue();
line += " =\t'" + value + "'\t("; line += " =\t'" + value + "'\t(";
line += getValueTypeString( line += getValueTypeString( child );
dir->getNode( name.c_str() ) );
line += ")"; line += ")";
} }
} }