Skip to content

Commit

Permalink
Two small fixes found by static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
snej committed Oct 12, 2023
1 parent 59109c7 commit 3431c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/PubSub.hh
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ namespace crouton::ps {
/// ```
template <typename P, typename S, typename PP = std::remove_reference_t<P>, typename SS = std::remove_reference_t<S>> requires(std::is_same_v<pub_type<PP>,sub_type<SS>>)
[[nodiscard]] S operator| (P&& pub, S&& sub) {
auto sharedP = std::make_shared<PP>(std::move(pub));
auto sharedP = std::make_shared<PP>(std::forward<P>(pub));
sub.subscribeTo(std::move(sharedP));
return sub;
}
Expand Down
2 changes: 1 addition & 1 deletion include/io/HTTPParser.hh
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace crouton::io::http {
ASYNC<string> entireBody();

/// After a call to parseData, returns body bytes that were read by the call.
string latestBodyData() {return std::move(_body);}
string latestBodyData() {string b(std::move(_body)); _body.clear(); return b;}

private:
Parser(IStream*, Role role);
Expand Down

0 comments on commit 3431c37

Please sign in to comment.