Use string::empty() rather than comparing val.c_str with NULL string

This commit is contained in:
tpaviot
2011-08-15 13:57:29 +02:00
parent b6bebbb01f
commit 2295e71ca1
+7 -7
View File
@@ -117,20 +117,20 @@ SCLundefined::asStr( std::string & s ) const {
const char *
SCLundefined::STEPwrite( std::string & s ) {
if (strcmp(val.c_str(),"")) {
s = val.c_str();
} else {
if ( val.empty() ) {
s = "$";
} else {
s = val.c_str();
}
return const_cast<char *>( s.c_str() );
}
void
SCLundefined:: STEPwrite( ostream & out ) {
if( strcmp(val.c_str(),"") ) {
out << val.c_str();
} else {
if( val.empty()) {
out << "$";
} else {
out << val.c_str();
}
}
@@ -165,7 +165,7 @@ SCLundefined::set_null() {
int
SCLundefined::is_null() {
return ( !strcmp( val.c_str(), "" ) );
return ( val.empty() );
}