Browse Source

LibVT: Use StringBuilder::string_view() instead of to_string()

This let's us avoid a heap allocation.
Idan Horowitz 3 years ago
parent
commit
ccad3d5a39
1 changed files with 1 additions and 2 deletions
  1. 1 2
      Userland/Libraries/LibVT/Terminal.cpp

+ 1 - 2
Userland/Libraries/LibVT/Terminal.cpp

@@ -1441,8 +1441,7 @@ void Terminal::handle_key_press(KeyCode key, u32 code_point, u8 flags)
 
 
     StringBuilder sb;
     StringBuilder sb;
     sb.append_code_point(code_point);
     sb.append_code_point(code_point);
-
-    emit_string(sb.to_string());
+    emit_string(sb.string_view());
 }
 }
 
 
 void Terminal::unimplemented_control_code(u8 code)
 void Terminal::unimplemented_control_code(u8 code)