mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 07:07:34 +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:
parent
be1e4f28cc
commit
8280dcfb89
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue