Skip to content

Commit 18d9db3

Browse files
committed
Fix issue that converted a unix timestamp to from nanoseconds to seconds twice
An incorrect cherry-pick caused us to device the nanoseconds twice by 1.000.000.000, when we should only divide it once.
1 parent 242e53d commit 18d9db3

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)