COMP: remove warning and check for assignment to itself in operator=
This commit is contained in:
parent
06d38d313f
commit
0143b83264
|
@ -77,6 +77,10 @@ RegularExpression::RegularExpression (const RegularExpression& rxp) {
|
||||||
// operator= -- Copies the given regular expression.
|
// operator= -- Copies the given regular expression.
|
||||||
RegularExpression& RegularExpression::operator= (const RegularExpression& rxp)
|
RegularExpression& RegularExpression::operator= (const RegularExpression& rxp)
|
||||||
{
|
{
|
||||||
|
if(this == &rxp)
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
if ( !rxp.program )
|
if ( !rxp.program )
|
||||||
{
|
{
|
||||||
this->program = 0;
|
this->program = 0;
|
||||||
|
|
Loading…
Reference in New Issue