From 8280dcfb89466bdc8ce3791e2792146586511fa8 Mon Sep 17 00:00:00 2001 From: Ben Wiederhake Date: Sat, 12 Sep 2020 01:07:36 +0200 Subject: [PATCH] LibC: Avoid write-back of unused value This might make sleep() faster by up to pi nanoseconds, or less. It's more about avoiding a senseless write than about optimization. --- Libraries/LibC/unistd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp index 4c7df9f0ce..f2fe6a379c 100644 --- a/Libraries/LibC/unistd.cpp +++ b/Libraries/LibC/unistd.cpp @@ -334,7 +334,7 @@ char* getwd(char* buf) int sleep(unsigned seconds) { struct timespec ts = { seconds, 0 }; - if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts) < 0) + if (clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, nullptr) < 0) return ts.tv_sec; return 0; }