mirror of
https://github.com/zeek/zeek.git
synced 2025-10-13 12:08:20 +00:00
Switch to using std::ranges algorithms
This commit is contained in:
parent
b4cbda4e02
commit
72c79006ac
42 changed files with 90 additions and 93 deletions
|
@ -192,7 +192,7 @@ string CPPCompile::BodyName(const FuncInfo& func) {
|
|||
auto canonicalize = [](char c) -> char { return isalnum(c) ? c : '_'; };
|
||||
|
||||
string fns = fn;
|
||||
transform(fns.begin(), fns.end(), fns.begin(), canonicalize);
|
||||
std::ranges::transform(fns, fns.begin(), canonicalize);
|
||||
|
||||
if ( ! isalpha(fns[0]) )
|
||||
// This can happen for filenames beginning with numbers.
|
||||
|
|
|
@ -3065,10 +3065,10 @@ IDPtr ConstructFromRecordExpr::FindMostCommonRecordSource(const ListExprPtr& exp
|
|||
return nullptr;
|
||||
|
||||
// Return the most common.
|
||||
auto max_entry = std::max_element(id_cnt.begin(), id_cnt.end(),
|
||||
[](const std::pair<IDPtr, int>& p1, const std::pair<IDPtr, int>& p2) {
|
||||
return p1.second < p2.second;
|
||||
});
|
||||
auto max_entry =
|
||||
std::ranges::max_element(id_cnt, [](const std::pair<IDPtr, int>& p1, const std::pair<IDPtr, int>& p2) {
|
||||
return p1.second < p2.second;
|
||||
});
|
||||
return max_entry->first;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue