[time.zone.db.tzdb]/1:
Each vector in a tzdb object is sorted to enable fast lookup.
The time zone names are sorted in the tzdb produced by MSVC's STL1, but locate_zone performs a linear search. It could be changed to a binary search, which would be faster.
|
template <class _Ty>
|
|
_NODISCARD const _Ty* _Locate_zone_impl(const vector<_Ty>& _Vec, string_view _Name) {
|
|
const auto _Result = _STD find_if(_Vec.begin(), _Vec.end(), [&](auto& _Tz) { return _Tz.name() == _Name; });
|
|
return _Result == _Vec.end() ? nullptr : &*_Result;
|
|
}
|
This is slightly more advanced than a "good first issue", requiring the contributor to understand how to perform binary search using std::lower_bound (not std::binary_search!).
[time.zone.db.tzdb]/1:
The time zone names are sorted in the
tzdbproduced by MSVC's STL1, butlocate_zoneperforms a linear search. It could be changed to a binary search, which would be faster.STL/stl/inc/chrono
Lines 2106 to 2110 in 41ec195
This is slightly more advanced than a "good first issue", requiring the contributor to understand how to perform binary search using
std::lower_bound(notstd::binary_search!).Footnotes
The data are obtained from ICU, and eventually from the
zoneinfo64resource.zoneinfo64is generated bytz2icu, which sorts the names by using astd::map. ↩