Skip to content

Commit 9b2d350

Browse files
committed
[refactoring][workflow]: Minimize buffer empty window by replacing clear/append with set in QOTD workflow
Removed qotd_buffer.clear() from get_quote_of_the_day to avoid unnecessary empty state. Changed m_quote_buffer.append(data) to m_quote_buffer.set(data) in QotdReceivedHandler, ensuring the buffer is atomically updated with new data. Signed-off-by: Goran Mišković <[email protected]>
1 parent 353b024 commit 9b2d350

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

src/QotdReceivedHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace e5 {
4646
// consume.
4747
const std::string data(peek_buffer, available);
4848

49-
m_quote_buffer.append(data);
49+
m_quote_buffer.set(data);
5050

5151
// Mark the data as consumed in the TCP buffer
5252
m_io.peekConsume(available);

src/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ void get_quote_of_the_day() {
102102
qotd_in_progress = false;
103103
DEBUGV("Failed to connect to QOTD server.\n");
104104
}
105-
qotd_buffer.clear();
106105
}
107106

108107
/**

0 commit comments

Comments
 (0)