Fix assertion. Fixes issue 99.

2.0
castano 15 years ago
parent 43ba8d50d4
commit 64db4c2379

@ -182,7 +182,6 @@ namespace nv
/// Dtor. /// Dtor.
~String() ~String()
{ {
nvDebugCheck(data != NULL);
release(); release();
} }
@ -219,38 +218,44 @@ namespace nv
/// Equal operator. /// Equal operator.
bool operator==( const String & str ) const bool operator==( const String & str ) const
{ {
nvDebugCheck(data != NULL);
nvDebugCheck(str.data != NULL);
if( str.data == data ) { if( str.data == data ) {
return true; return true;
} }
if ((data == NULL) != (str.data == NULL)) {
return false;
}
return strcmp(data, str.data) == 0; return strcmp(data, str.data) == 0;
} }
/// Equal operator. /// Equal operator.
bool operator==( const char * str ) const bool operator==( const char * str ) const
{ {
nvDebugCheck(data != NULL);
nvCheck(str != NULL); // Use isNull! nvCheck(str != NULL); // Use isNull!
if (data == NULL) {
return false;
}
return strcmp(data, str) == 0; return strcmp(data, str) == 0;
} }
/// Not equal operator. /// Not equal operator.
bool operator!=( const String & str ) const bool operator!=( const String & str ) const
{ {
nvDebugCheck(data != NULL);
nvDebugCheck(str.data != NULL);
if( str.data == data ) { if( str.data == data ) {
return false; return false;
} }
if ((data == NULL) != (str.data == NULL)) {
return true;
}
return strcmp(data, str.data) != 0; return strcmp(data, str.data) != 0;
} }
/// Not equal operator. /// Not equal operator.
bool operator!=( const char * str ) const bool operator!=( const char * str ) const
{ {
nvDebugCheck(data != NULL);
nvCheck(str != NULL); // Use isNull! nvCheck(str != NULL); // Use isNull!
if (data == NULL) {
return false;
}
return strcmp(data, str) != 0; return strcmp(data, str) != 0;
} }

Loading…
Cancel
Save