tweaks: don't bother to reallocate when the keybuffer size decreases
It will be reallocated soon enough when the size increases again.master
parent
4c7ec18a55
commit
90cf4838d2
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue