Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
resetius committed Nov 25, 2023
1 parent 6517877 commit 43288ca
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ struct TPromise
}

T await_resume() {
T r (std::move(*this->promise().Value));
this->promise().Value.reset();
this->destroy();
return r;
return *this->promise().Value;
}
};

Expand Down Expand Up @@ -64,9 +61,7 @@ struct TPromise<void>
this->promise().Caller = caller;
}

void await_resume() {
this->destroy();
}
void await_resume() { }
};

TTask get_return_object() { return { TTask::from_promise(*this) }; }
Expand Down

0 comments on commit 43288ca

Please sign in to comment.