Skip to content

Commit

Permalink
Refine setTimeout by const reference
Browse files Browse the repository at this point in the history
  • Loading branch information
shuai132 committed Aug 21, 2019
1 parent 683e12d commit 907b9f4
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/serial/impl/unix.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class serial::Serial::SerialImpl {
getPort () const;

void
setTimeout (Timeout &timeout);
setTimeout (const Timeout &timeout);

Timeout
getTimeout () const;
Expand Down
2 changes: 1 addition & 1 deletion include/serial/impl/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class serial::Serial::SerialImpl {
getPort () const;

void
setTimeout (Timeout &timeout);
setTimeout (const Timeout &timeout);

Timeout
getTimeout () const;
Expand Down
2 changes: 1 addition & 1 deletion include/serial/serial.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class Serial {
* \see serial::Timeout
*/
void
setTimeout (Timeout &timeout);
setTimeout (const Timeout &timeout);

/*! Sets the timeout for reads and writes. */
void
Expand Down
2 changes: 1 addition & 1 deletion src/impl/unix.cc
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ Serial::SerialImpl::getPort () const
}

void
Serial::SerialImpl::setTimeout (serial::Timeout &timeout)
Serial::SerialImpl::setTimeout (const serial::Timeout &timeout)
{
timeout_ = timeout;
}
Expand Down
2 changes: 1 addition & 1 deletion src/impl/win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ Serial::SerialImpl::getPort () const
}

void
Serial::SerialImpl::setTimeout (serial::Timeout &timeout)
Serial::SerialImpl::setTimeout (const serial::Timeout &timeout)
{
timeout_ = timeout;
if (is_open_) {
Expand Down
2 changes: 1 addition & 1 deletion src/serial.cc
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ Serial::getPort () const
}

void
Serial::setTimeout (serial::Timeout &timeout)
Serial::setTimeout (const serial::Timeout &timeout)
{
pimpl_->setTimeout (timeout);
}
Expand Down

0 comments on commit 907b9f4

Please sign in to comment.