HttpHeaders: Check assigning self in operator=()
This commit is contained in:
@@ -102,7 +102,7 @@ BHttpResult::StatusText() const
|
|||||||
bool
|
bool
|
||||||
BHttpResult::HasHeaders() const
|
BHttpResult::HasHeaders() const
|
||||||
{
|
{
|
||||||
return (fHeaders.CountHeaders() > 0);
|
return fHeaders.CountHeaders() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -112,6 +112,9 @@ BHttpResult::HasHeaders() const
|
|||||||
BHttpResult&
|
BHttpResult&
|
||||||
BHttpResult::operator=(const BHttpResult& other)
|
BHttpResult::operator=(const BHttpResult& other)
|
||||||
{
|
{
|
||||||
|
if (this == &other)
|
||||||
|
return *this;
|
||||||
|
|
||||||
fUrl = other.fUrl;
|
fUrl = other.fUrl;
|
||||||
fHeaders = other.fHeaders;
|
fHeaders = other.fHeaders;
|
||||||
fStatusCode = other.fStatusCode;
|
fStatusCode = other.fStatusCode;
|
||||||
|
|||||||
Reference in New Issue
Block a user