Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit e807e29

Browse files
authored
Merge pull request #2315 from n8sh/issue-19280
Fix Issue 19280 - Remove unnecessary error checks in core.time.currSystemTick merged-on-behalf-of: Petar Kirov <ZombineDev@users.noreply.github.com>
2 parents a59c383 + 6e8b379 commit e807e29

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/core/time.d

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3344,10 +3344,8 @@ struct TickDuration
33443344
import core.internal.abort : abort;
33453345
version (Windows)
33463346
{
3347-
ulong ticks;
3348-
if (QueryPerformanceCounter(cast(long*)&ticks) == 0)
3349-
abort("Failed in QueryPerformanceCounter().");
3350-
3347+
ulong ticks = void;
3348+
QueryPerformanceCounter(cast(long*)&ticks);
33513349
return TickDuration(ticks);
33523350
}
33533351
else version (Darwin)
@@ -3356,10 +3354,8 @@ struct TickDuration
33563354
return TickDuration(cast(long)mach_absolute_time());
33573355
else
33583356
{
3359-
timeval tv;
3360-
if (gettimeofday(&tv, null) != 0)
3361-
abort("Failed in gettimeofday().");
3362-
3357+
timeval tv = void;
3358+
gettimeofday(&tv, null);
33633359
return TickDuration(tv.tv_sec * TickDuration.ticksPerSec +
33643360
tv.tv_usec * TickDuration.ticksPerSec / 1000 / 1000);
33653361
}
@@ -3377,10 +3373,8 @@ struct TickDuration
33773373
}
33783374
else
33793375
{
3380-
timeval tv;
3381-
if (gettimeofday(&tv, null) != 0)
3382-
abort("Failed in gettimeofday().");
3383-
3376+
timeval tv = void;
3377+
gettimeofday(&tv, null);
33843378
return TickDuration(tv.tv_sec * TickDuration.ticksPerSec +
33853379
tv.tv_usec * TickDuration.ticksPerSec / 1000 / 1000);
33863380
}

0 commit comments

Comments
 (0)