diff options
author | Idan Horowitz <idan.horowitz@gmail.com> | 2022-02-15 23:43:32 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-16 22:21:37 +0100 |
commit | ccad3d5a39b9230510f1cead786ab0dd5d157652 (patch) | |
tree | c5d65c954640eef4c326846ad4839a226ba2b3cd /Userland | |
parent | b22cb40565b118632b635bce0028d6a037d906d1 (diff) | |
download | serenity-ccad3d5a39b9230510f1cead786ab0dd5d157652.zip |
LibVT: Use StringBuilder::string_view() instead of to_string()
This let's us avoid a heap allocation.
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibVT/Terminal.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Libraries/LibVT/Terminal.cpp b/Userland/Libraries/LibVT/Terminal.cpp index d7e216c6ee..f5f0d96f14 100644 --- a/Userland/Libraries/LibVT/Terminal.cpp +++ b/Userland/Libraries/LibVT/Terminal.cpp @@ -1441,8 +1441,7 @@ void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags) StringBuilder sb; sb.append_code_point(code_point); - - emit_string(sb.to_string()); + emit_string(sb.string_view()); } void Terminal::unimplemented_control_code(u8 code) |