Skip to content

Commit 4c01f3d

Browse files
authored
Merge pull request #194 from ahoppen/only-divide-once
Fix issue that converted a unix timestamp to from nanoseconds to seconds twice
2 parents 242e53d + 18d9db3 commit 4c01f3d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/CIndexStoreDB/CIndexStoreDB.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,7 @@ indexstoredb_timestamp_of_latest_unit_for_file(
679679
// https://en.cppreference.com/w/cpp/chrono/system_clock most implementations use Unix Time.
680680
// Since C++20, system_clock is defined to measure time since 1/1/1970.
681681
// We rely on `time_since_epoch` always returning the nanoseconds since 1/1/1970.
682-
auto nanosecondsSinceEpoch = timePoint->time_since_epoch().count();
683-
return static_cast<double>(nanosecondsSinceEpoch) / 1000 / 1000 / 1000;
682+
return timePoint->time_since_epoch().count();
684683
}
685684
return 0;
686685
}

0 commit comments

Comments
 (0)