Skip to content

Commit fabefe9

Browse files
committed
Ensure leap seconds are sorted by JD
1 parent e9c7a41 commit fabefe9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/celestia/celestiacore.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ bool ReadLeapSecondsFile(const fs::path& path, std::vector<astro::LeapSecondReco
188188
leapSeconds.push_back({seconds, jd});
189189
}
190190

191+
std::sort(leapSeconds.begin(), leapSeconds.end(), [](const auto& a, const auto& b) { return a.t < b.t; });
192+
191193
astro::setLeapSeconds(leapSeconds);
192194
return true;
193195
}

0 commit comments

Comments
 (0)