Get rid of unused functions in util/json_util.hpp (#6446)
This commit is contained in:
parent
aeaf5e0735
commit
5f82d0c9ba
@ -4,6 +4,7 @@
|
||||
- CHANGED: Update actions/cache to v3. [#6420](https://github.com/Project-OSRM/osrm-backend/pull/6420)
|
||||
- REMOVED: Drop support of Node 12 & 14. [#6431](https://github.com/Project-OSRM/osrm-backend/pull/6431)
|
||||
- Misc:
|
||||
- REMOVED: Get rid of unused functions in util/json_util.hpp. [#6446](https://github.com/Project-OSRM/osrm-backend/pull/6446)
|
||||
- FIXED: Apply workaround for Conan installation issue on CI. [#6442](https://github.com/Project-OSRM/osrm-backend/pull/6442)
|
||||
- FIXED: Fix `npm audit` warnings in NPM package. [#6437](https://github.com/Project-OSRM/osrm-backend/pull/6437)
|
||||
- FIXED: Handle snapping parameter for all plugins in NodeJs bindings, but not for Route only. [#6417](https://github.com/Project-OSRM/osrm-backend/pull/6417)
|
||||
|
@ -1,22 +0,0 @@
|
||||
#ifndef CONTAINER_HPP
|
||||
#define CONTAINER_HPP
|
||||
|
||||
#include <utility>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
|
||||
template <class Container> void append_to_container(Container &&) {}
|
||||
|
||||
template <class Container, typename T, typename... Args>
|
||||
void append_to_container(Container &&container, T value, Args &&... args)
|
||||
{
|
||||
container.emplace_back(value);
|
||||
append_to_container(std::forward<Container>(container), std::forward<Args>(args)...);
|
||||
}
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
||||
#endif
|
@ -2,7 +2,6 @@
|
||||
#define JSON_UTIL_HPP
|
||||
|
||||
#include "osrm/json_container.hpp"
|
||||
#include "util/container.hpp"
|
||||
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
@ -27,30 +26,6 @@ template <typename T> T clamp_float(T d)
|
||||
|
||||
return d;
|
||||
}
|
||||
|
||||
template <typename... Args> Array make_array(Args... args)
|
||||
{
|
||||
Array a;
|
||||
// TODO: check why a.values.emplace_back(args...); is not an option here
|
||||
append_to_container(a.values, args...);
|
||||
return a;
|
||||
}
|
||||
|
||||
// Easy acces to object hierachies
|
||||
inline Value &get(Value &value) { return value; }
|
||||
|
||||
template <typename... Keys> Value &get(Value &value, const char *key, Keys... keys)
|
||||
{
|
||||
using recursive_object_t = mapbox::util::recursive_wrapper<Object>;
|
||||
return get(value.get<recursive_object_t>().get().values[key], keys...);
|
||||
}
|
||||
|
||||
template <typename... Keys> Value &get(Value &value, unsigned key, Keys... keys)
|
||||
{
|
||||
using recursive_array_t = mapbox::util::recursive_wrapper<Array>;
|
||||
return get(value.get<recursive_array_t>().get().values[key], keys...);
|
||||
}
|
||||
|
||||
} // namespace json
|
||||
} // namespace util
|
||||
} // namespace osrm
|
||||
|
Loading…
Reference in New Issue
Block a user