1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:47:35 +00:00

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.
This commit is contained in:
Ben Wiederhake 2020-09-12 01:07:36 +02:00 committed by Andreas Kling
parent be1e4f28cc
commit 8280dcfb89

View file

@ -334,7 +334,7 @@ char* getwd(char* buf)
int sleep(unsigned seconds) int sleep(unsigned seconds)
{ {
struct timespec ts = { seconds, 0 }; 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 ts.tv_sec;
return 0; return 0;
} }