From 4ac08ce05ec645704befa84c7fb662f36f3ccdef Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Wed, 27 Jan 2021 00:33:53 +0800 Subject: [PATCH] TTYPigeon::send : delete unnecessary temporary variables (#19898) Co-authored-by: Willem Melching --- selfdrive/boardd/pigeon.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/selfdrive/boardd/pigeon.cc b/selfdrive/boardd/pigeon.cc index cd032f9a82..04ad4c5f7e 100644 --- a/selfdrive/boardd/pigeon.cc +++ b/selfdrive/boardd/pigeon.cc @@ -181,10 +181,8 @@ void TTYPigeon::set_baud(int baud){ } void TTYPigeon::send(const std::string &s) { - int len = s.length(); - const char * dat = s.data(); + int err = write(pigeon_tty_fd, s.data(), s.length()); - int err = write(pigeon_tty_fd, dat, len); if(err < 0) { handle_tty_issue(err, __func__); } err = tcdrain(pigeon_tty_fd); if(err < 0) { handle_tty_issue(err, __func__); }