Merge pull request #66320 from waynexia/period-detect

Avoid unneeded calculation in SeriesPeriodDetect
This commit is contained in:
Nikita Taranov 2024-08-08 21:44:54 +00:00 committed by GitHub
commit e501894767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -153,12 +153,8 @@ public:
return true;
}
std::vector<double> xfreq(spec_len);
double step = 0.5 / (spec_len - 1);
for (size_t i = 0; i < spec_len; ++i)
xfreq[i] = i * step;
auto freq = xfreq[idx];
auto freq = idx * step;
period = std::round(1 / freq);
return true;