Remove unnecessary argument(tp) in gettimeofday() call for retrieving timezone (#12722)
changes the `gettimeofday` caller, by removing an unused optional output argument. It would take 2 benefits: - simplify code, discard unnecessary arg. - possibly faster due to the implementation in kernel.
This commit is contained in:
parent
282b82e9d2
commit
a888503b4f
@ -993,10 +993,9 @@ long getTimeZone(void) {
|
|||||||
#if defined(__linux__) || defined(__sun)
|
#if defined(__linux__) || defined(__sun)
|
||||||
return timezone;
|
return timezone;
|
||||||
#else
|
#else
|
||||||
struct timeval tv;
|
|
||||||
struct timezone tz;
|
struct timezone tz;
|
||||||
|
|
||||||
gettimeofday(&tv, &tz);
|
gettimeofday(NULL, &tz);
|
||||||
|
|
||||||
return tz.tz_minuteswest * 60L;
|
return tz.tz_minuteswest * 60L;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user