Skip to content
This repository has been archived by the owner on Oct 1, 2023. It is now read-only.

Commit

Permalink
Fix integer underflow on empty data vector (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Sep 29, 2023
1 parent 2a64377 commit 97ff9bc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ template <size_t S, size_t Timestamp, size_t Voltage, size_t Position,
static std::vector<PreparedData> ConvertToPrepared(
const std::vector<std::array<double, S>>& data) {
std::vector<PreparedData> prepared;
for (size_t i = 0; i < data.size() - 1; i++) {
for (int i = 0; i < static_cast<int>(data.size()) - 1; ++i) {
const auto& pt1 = data[i];
const auto& pt2 = data[i + 1];
prepared.emplace_back(PreparedData{
Expand Down

0 comments on commit 97ff9bc

Please sign in to comment.