From 396be90974e3f4ba4e470cc88584f036d03c4475 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 16 Feb 2020 21:06:15 +0000 Subject: Reduce interval indirection by setting struct members directly and using macros from sys/time.h OK millert --- usr.bin/dig/lib/isc/unix/time.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'usr.bin/dig/lib/isc/unix/time.c') diff --git a/usr.bin/dig/lib/isc/unix/time.c b/usr.bin/dig/lib/isc/unix/time.c index e666dfc042c..77c581a0016 100644 --- a/usr.bin/dig/lib/isc/unix/time.c +++ b/usr.bin/dig/lib/isc/unix/time.c @@ -14,7 +14,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: time.c,v 1.9 2020/02/16 21:04:44 florian Exp $ */ +/* $Id: time.c,v 1.10 2020/02/16 21:06:15 florian Exp $ */ /*! \file */ @@ -43,32 +43,6 @@ * need an initialized type. */ -/*% - *** Intervals - ***/ - -void -interval_set(struct timespec *i, time_t seconds, long nanoseconds) -{ - REQUIRE(i != NULL); - REQUIRE(nanoseconds < NS_PER_S); - - i->tv_sec = seconds; - i->tv_nsec = nanoseconds; -} - -isc_boolean_t -interval_iszero(const struct timespec *i) { - REQUIRE(i != NULL); - INSIST(i->tv_nsec < NS_PER_S); - - if (!timespecisset(i)) - return (ISC_TRUE); - - return (ISC_FALSE); -} - - /*** *** Absolute Times ***/ -- cgit v1.2.3-59-g8ed1b