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
Notes:
sideshowbarker
2024-07-19 02:44:09 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/8280dcfb894 Pull-request: https://github.com/SerenityOS/serenity/pull/3464
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue