Fix formatting

This commit is contained in:
Dennis 2024-05-23 10:19:40 +02:00
parent ce755adb97
commit 8412716ce4
No known key found for this signature in database
GPG Key ID: 6937EAEA33A3FA5D
5 changed files with 16 additions and 15 deletions

View File

@ -3,8 +3,8 @@
#include "extractor/class_data.hpp"
#include "extractor/turn_lane_types.hpp"
#include "util/typedefs.hpp"
#include "util/std_hash.hpp"
#include "util/typedefs.hpp"
#include <string>
#include <unordered_map>

View File

@ -1,8 +1,8 @@
#ifndef OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
#define OSRM_EXTRACTOR_TRAFFIC_SIGNALS_HPP
#include "util/typedefs.hpp"
#include "util/std_hash.hpp"
#include "util/typedefs.hpp"
#include <unordered_set>
#include <utility>

View File

@ -62,7 +62,8 @@ inline size_t hash<::osrm::util::guidance::BearingClass>::operator()(
const ::osrm::util::guidance::BearingClass &bearing_class) const
{
std::size_t value = 0;
hash_range(value, bearing_class.available_bearings.cbegin(), bearing_class.available_bearings.cend());
hash_range(
value, bearing_class.available_bearings.cbegin(), bearing_class.available_bearings.cend());
return value;
}
} // namespace std

View File

@ -17,7 +17,6 @@ class LaneTuple;
class LaneTupleIdPair;
} // namespace osrm::util::guidance
namespace osrm::util::guidance
{
@ -63,10 +62,12 @@ using LaneDataIdMap = ConcurrentIDMap<LaneTupleIdPair, LaneDataID>;
} // namespace osrm::util::guidance
namespace std {
template <> struct hash<::osrm::util::guidance::LaneTuple>
namespace std
{
inline std::size_t operator()(const ::osrm::util::guidance::LaneTuple &lane_tuple) const {
template <> struct hash<::osrm::util::guidance::LaneTuple>
{
inline std::size_t operator()(const ::osrm::util::guidance::LaneTuple &lane_tuple) const
{
std::size_t seed{0};
hash_combine(seed, lane_tuple.lanes_in_turn);
hash_combine(seed, lane_tuple.first_lane_from_the_right);
@ -77,7 +78,8 @@ namespace std {
template <> struct hash<::osrm::util::guidance::LaneTupleIdPair>
{
inline std::size_t
operator()(const ::osrm::util::guidance::LaneTupleIdPair &lane_tuple_id_pair) const {
operator()(const ::osrm::util::guidance::LaneTupleIdPair &lane_tuple_id_pair) const
{
std::size_t seed{0};
hash_combine(seed, lane_tuple_id_pair.first);
hash_combine(seed, lane_tuple_id_pair.second);
@ -86,5 +88,4 @@ template <> struct hash<::osrm::util::guidance::LaneTupleIdPair>
};
} // namespace std
#endif /* OSRM_UTIL_GUIDANCE_TURN_LANES_HPP */

View File

@ -15,9 +15,9 @@ template <typename T> void hash_combine(std::size_t &seed, const T &val)
seed ^= std::hash<T>()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template<typename It> void hash_range(std::size_t& seed, It first, const It last)
template <typename It> void hash_range(std::size_t &seed, It first, const It last)
{
for(; first != last; ++first)
for (; first != last; ++first)
{
hash_combine(seed, *first);
}
@ -41,10 +41,9 @@ template <typename... Types> std::size_t hash_val(const Types &...args)
namespace std
{
template <typename ...T>
struct hash<std::tuple<T...>>
template <typename... T> struct hash<std::tuple<T...>>
{
template <std::size_t ...I>
template <std::size_t... I>
static auto apply_tuple(const std::tuple<T...> &t, std::index_sequence<I...>)
{
std::size_t seed = 0;