Codechange: Use std::range::find_if where possible.

This commit is contained in:
Peter Nelson
2024-11-10 10:57:48 +00:00
committed by Peter Nelson
parent 059a4b22f7
commit fa1849b855
10 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -612,7 +612,7 @@ void PickerWindow::EnsureSelectedTypeIsVisible()
int class_index = this->callbacks.GetSelectedClass();
int index = this->callbacks.GetSelectedType();
auto it = std::find_if(std::begin(this->types), std::end(this->types), [class_index, index](const auto &item) { return item.class_index == class_index && item.index == index; });
auto it = std::ranges::find_if(this->types, [class_index, index](const auto &item) { return item.class_index == class_index && item.index == index; });
if (it == std::end(this->types)) return;
int pos = static_cast<int>(std::distance(std::begin(this->types), it));