Commit 90cf4838 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: don't bother to reallocate when the keybuffer size decreases

It will be reallocated soon enough when the size increases again.
parent 4c7ec18a
Showing with 1 addition and 4 deletions
+1 -4
......@@ -316,12 +316,9 @@ int *get_input(WINDOW *win, size_t input_len)
key_buffer_len -= input_len;
/* If the buffer still contains keystrokes, move them to the front. */
if (key_buffer_len > 0) {
if (key_buffer_len > 0)
memmove(key_buffer, key_buffer + input_len, key_buffer_len *
sizeof(int));
key_buffer = (int *)nrealloc(key_buffer, key_buffer_len *
sizeof(int));
}
return input;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment