1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-22 18:28:52 -05:00

Wayland: Remove superfluous global struct member

It seems unlikely that strlen will be a bottleneck when sending
clipboard contents.
This commit is contained in:
Camilla Löwy 2022-03-22 19:04:29 +01:00
parent b386371f57
commit 738b1c73b5
2 changed files with 1 additions and 3 deletions

View File

@ -308,7 +308,6 @@ typedef struct _GLFWlibraryWayland
char* clipboardString;
size_t clipboardSize;
char* clipboardSendString;
size_t clipboardSendSize;
int timerfd;
short int keycodes[256];
short int scancodes[GLFW_KEY_LAST + 1];

View File

@ -1592,7 +1592,7 @@ static void dataSourceHandleSend(void* data,
int fd)
{
const char* string = _glfw.wl.clipboardSendString;
size_t len = _glfw.wl.clipboardSendSize;
size_t len = strlen(string);
int ret;
if (_glfw.wl.dataSource != dataSource)
@ -1675,7 +1675,6 @@ void _glfwSetClipboardStringWayland(const char* string)
_glfw_free(_glfw.wl.clipboardSendString);
_glfw.wl.clipboardSendString = copy;
_glfw.wl.clipboardSendSize = strlen(_glfw.wl.clipboardSendString);
_glfw.wl.dataSource =
wl_data_device_manager_create_data_source(_glfw.wl.dataDeviceManager);
if (!_glfw.wl.dataSource)