feat: improve find in files performance

This commit is contained in:
CJ van den Berg 2024-07-28 00:13:18 +02:00
parent f535fc02bf
commit 5f22ce81bc
2 changed files with 1 additions and 2 deletions

View file

@ -169,7 +169,7 @@ fn insert_bytes(self: *Self, bytes: []const u8) !void {
var find_cmd_id: ?command.ID = null;
fn flush_input(self: *Self) !void {
if (self.input.len > 0) {
if (self.input.len > 2) {
if (eql(u8, self.input, self.last_input))
return;
@memcpy(self.last_buf[0..self.input.len], self.input);