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.
No related merge requests found
Showing with 1 addition and 4 deletions
+1 -4
...@@ -316,12 +316,9 @@ int *get_input(WINDOW *win, size_t input_len) ...@@ -316,12 +316,9 @@ int *get_input(WINDOW *win, size_t input_len)
key_buffer_len -= input_len; key_buffer_len -= input_len;
/* If the buffer still contains keystrokes, move them to the front. */ /* 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 * memmove(key_buffer, key_buffer + input_len, key_buffer_len *
sizeof(int)); sizeof(int));
key_buffer = (int *)nrealloc(key_buffer, key_buffer_len *
sizeof(int));
}
return input; 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