Skip to content

Commit

Permalink
Avoid pointless clear to return buffer
Browse files Browse the repository at this point in the history
The vector was being cleared then resized immediately after and its contents replaced, only do directly the resize
  • Loading branch information
edo9300 committed Feb 19, 2024
1 parent a5de6e3 commit b77e397
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion duel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ void duel::clear_buffer() {
buff.clear();
}
void duel::set_response(const void* resp, size_t len) {
game_field->returns.clear();
game_field->returns.data.resize(len);
if(len)
std::memcpy(game_field->returns.data.data(), resp, len);
Expand Down

0 comments on commit b77e397

Please sign in to comment.