Connection::Buffer: Improve performance for deleting \r suffix
This commit is contained in:
@ -72,7 +72,8 @@ class Runner::Connection::Buffer
|
||||
@global_buffer = +''
|
||||
# For our buffering, we identified line breaks with the `\n` and removed those temporarily.
|
||||
# Thus, we now re-add the `\n` at the end of the string and (optionally) remove a trailing `\r` at the same time.
|
||||
message = "#{message.delete_suffix("\r")}\n"
|
||||
message.delete_suffix!("\r")
|
||||
message += "\n"
|
||||
@line_buffer.push message
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user