Remove unsafe Status::operator==.
This commit is contained in:
parent
5b09f60629
commit
d93c06fceb
@ -67,7 +67,7 @@ class RequestActor : public Actor {
|
||||
void raw_event(const Event::Raw &event) final {
|
||||
if (future_.is_error()) {
|
||||
auto error = future_.move_as_error();
|
||||
if (error == Status::Error<FutureActor<T>::HANGUP_ERROR_CODE>()) {
|
||||
if (error.is_static() && error.code() == FutureActor<T>::HANGUP_ERROR_CODE) {
|
||||
// dropping query due to closing or lost promise
|
||||
if (G()->close_flag()) {
|
||||
do_send_error(Global::request_aborted_error());
|
||||
|
@ -151,8 +151,11 @@ class Status {
|
||||
public:
|
||||
Status() = default;
|
||||
|
||||
bool operator==(const Status &other) const {
|
||||
return ptr_ == other.ptr_;
|
||||
bool is_static() const {
|
||||
if (is_ok()) {
|
||||
return true;
|
||||
}
|
||||
return get_info().static_flag;
|
||||
}
|
||||
|
||||
Status clone() const TD_WARN_UNUSED_RESULT {
|
||||
|
Loading…
Reference in New Issue
Block a user