From 89cfb9d850466cc2b962ade28ad48ea741dd5a7d Mon Sep 17 00:00:00 2001 From: BodgeMaster <> Date: Fri, 21 Oct 2022 23:00:38 +0200 Subject: [PATCH] tools/hexnet: Reduce redundant code --- src/tools/hexnet.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/tools/hexnet.cpp b/src/tools/hexnet.cpp index e73fb4b..c3d94ee 100644 --- a/src/tools/hexnet.cpp +++ b/src/tools/hexnet.cpp @@ -68,20 +68,11 @@ void signalHandler(int signal) { void readFromTCPSocket() { ssize_t byteCount; uint8_t buffer[1536]; - if (outgoing) { - while (!exitProgram && (byteCount = tcpConnector.read(buffer, sizeof(buffer))) > 0) { - for (ssize_t i=0; i 0) { - for (ssize_t i=0; i 0 : (byteCount = tcpSocket.read(buffer, sizeof(buffer))) > 0)) { + for (ssize_t i=0; i