diff --git a/src/insert_completer.cc b/src/insert_completer.cc index d54b85e3..c2659579 100644 --- a/src/insert_completer.cc +++ b/src/insert_completer.cc @@ -159,9 +159,9 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o std::sort(matches.begin(), matches.end()); matches.erase(std::unique(matches.begin(), matches.end()), matches.end()); - const auto longest = std::accumulate(matches.begin(), matches.end(), 0_char, - [](const CharCount& lhs, const RankedMatchAndBuffer& rhs) - { return std::max(lhs, rhs.candidate().char_length()); }); + const auto longest = accumulate(matches, 0_char, + [](const CharCount& lhs, const RankedMatchAndBuffer& rhs) + { return std::max(lhs, rhs.candidate().char_length()); }); InsertCompletion::CandidateList candidates; candidates.reserve(matches.size()); diff --git a/src/shared_string.cc b/src/shared_string.cc index eb12ca27..74c6c106 100644 --- a/src/shared_string.cc +++ b/src/shared_string.cc @@ -6,9 +6,9 @@ namespace Kakoune StringDataPtr StringData::create(ArrayView strs) { - const int len = std::accumulate(strs.begin(), strs.end(), 0, - [](int l, StringView s) - { return l + (int)s.length(); }); + const int len = accumulate(strs, 0, [](int l, StringView s) { + return l + (int)s.length(); + }); void* ptr = StringData::operator new(sizeof(StringData) + len + 1); auto* res = new (ptr) StringData(len); auto* data = reinterpret_cast(res + 1);