Skip to content

Commit

Permalink
Pass const reference for LookupOptions
Browse files Browse the repository at this point in the history
Summary: As titled, no need to copy this (small) object.

Reviewed By: cristianlumezanu

Differential Revision: D48356872

fbshipit-source-id: 99f548ce9b2de29583cc68f01cd4eb61dc13d80f
  • Loading branch information
Brandon Schlinker authored and facebook-github-bot committed Aug 26, 2023
1 parent 4c5add4 commit d463d82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion folly/io/async/AsyncSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2876,7 +2876,7 @@ bool AsyncSocket::processZeroCopyWriteInProgress() noexcept {
}

folly::Expected<folly::TcpInfo, std::errc> AsyncSocket::getTcpInfo(
TcpInfo::LookupOptions options) {
const TcpInfo::LookupOptions& options) {
if (NetworkSocket() == fd_) {
return folly::makeUnexpected(std::errc::invalid_argument);
}
Expand Down
2 changes: 1 addition & 1 deletion folly/io/async/AsyncSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -1186,7 +1186,7 @@ class AsyncSocket : public AsyncSocketTransport {
* Get folly::TcpInfo from socket
*/
folly::Expected<folly::TcpInfo, std::errc> getTcpInfo(
TcpInfo::LookupOptions options);
const TcpInfo::LookupOptions& options);

/**
* writeReturn is the total number of bytes written, or WRITE_ERROR on error.
Expand Down

0 comments on commit d463d82

Please sign in to comment.