COMP: remove warning and check for assignment to itself in operator=

This commit is contained in:
Bill Hoffman 2008-07-10 17:20:14 -04:00
parent 06d38d313f
commit 0143b83264
1 changed files with 4 additions and 0 deletions

View File

@ -77,6 +77,10 @@ RegularExpression::RegularExpression (const RegularExpression& rxp) {
// operator= -- Copies the given regular expression.
RegularExpression& RegularExpression::operator= (const RegularExpression& rxp)
{
if(this == &rxp)
{
return *this;
}
if ( !rxp.program )
{
this->program = 0;