mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-04-28 21:07:59 +03:00
Apply clang-format to code base
This commit is contained in:
parent
f37d0be806
commit
ddb0522bbf
2199 changed files with 118692 additions and 114392 deletions
|
@ -12,11 +12,7 @@ namespace Misc
|
|||
inline Iterator forEachUnique(Iterator begin, Iterator end, BinaryPredicate predicate, Function function)
|
||||
{
|
||||
static_assert(
|
||||
std::is_base_of_v<
|
||||
std::forward_iterator_tag,
|
||||
typename std::iterator_traits<Iterator>::iterator_category
|
||||
>
|
||||
);
|
||||
std::is_base_of_v<std::forward_iterator_tag, typename std::iterator_traits<Iterator>::iterator_category>);
|
||||
if (begin == end)
|
||||
return begin;
|
||||
function(*begin);
|
||||
|
@ -35,20 +31,20 @@ namespace Misc
|
|||
}
|
||||
|
||||
/// Performs a binary search on a sorted container for a string that 'key' starts with
|
||||
template<typename Iterator, typename T>
|
||||
template <typename Iterator, typename T>
|
||||
static Iterator partialBinarySearch(Iterator begin, Iterator end, const T& key)
|
||||
{
|
||||
const Iterator notFound = end;
|
||||
|
||||
while(begin < end)
|
||||
while (begin < end)
|
||||
{
|
||||
const Iterator middle = begin + (std::distance(begin, end) / 2);
|
||||
|
||||
int comp = Misc::StringUtils::ciCompareLen((*middle), key, (*middle).size());
|
||||
|
||||
if(comp == 0)
|
||||
if (comp == 0)
|
||||
return middle;
|
||||
else if(comp > 0)
|
||||
else if (comp > 0)
|
||||
end = middle;
|
||||
else
|
||||
begin = middle + 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue