add comments
This commit is contained in:
parent
666ff1c9e5
commit
d2ce6d2720
1
.github/workflows/osrm-backend.yml
vendored
1
.github/workflows/osrm-backend.yml
vendored
@ -715,6 +715,7 @@ jobs:
|
|||||||
pushd ${OSRM_BUILD_DIR}
|
pushd ${OSRM_BUILD_DIR}
|
||||||
make --jobs=${JOBS} benchmarks
|
make --jobs=${JOBS} benchmarks
|
||||||
./src/benchmarks/alias-bench
|
./src/benchmarks/alias-bench
|
||||||
|
./src/benchmarks/json-render-bench
|
||||||
./src/benchmarks/match-bench ../test/data/ch/monaco.osrm
|
./src/benchmarks/match-bench ../test/data/ch/monaco.osrm
|
||||||
./src/benchmarks/packedvector-bench
|
./src/benchmarks/packedvector-bench
|
||||||
./src/benchmarks/rtree-bench ../test/data/monaco.osrm.ramIndex ../test/data/monaco.osrm.fileIndex ../test/data/monaco.osrm.nbg_nodes
|
./src/benchmarks/rtree-bench ../test/data/monaco.osrm.ramIndex ../test/data/monaco.osrm.fileIndex ../test/data/monaco.osrm.nbg_nodes
|
||||||
|
|||||||
@ -34,10 +34,11 @@ template <typename Out> struct Renderer
|
|||||||
void operator()(const String &string)
|
void operator()(const String &string)
|
||||||
{
|
{
|
||||||
write('"');
|
write('"');
|
||||||
|
// here we assume that vast majority of strings don't need to be escaped,
|
||||||
|
// so we check it first and escape only if needed
|
||||||
auto size = SizeOfEscapedJSONString(string.value);
|
auto size = SizeOfEscapedJSONString(string.value);
|
||||||
if (size == string.value.size())
|
if (size == string.value.size())
|
||||||
{
|
{
|
||||||
// we don't need to escape anything
|
|
||||||
write(string.value);
|
write(string.value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -106,7 +106,8 @@ int main(int, char **)
|
|||||||
TIMER_STOP(vector);
|
TIMER_STOP(vector);
|
||||||
std::cout << "Vector: " << TIMER_MSEC(vector) << "ms" << std::endl;
|
std::cout << "Vector: " << TIMER_MSEC(vector) << "ms" << std::endl;
|
||||||
|
|
||||||
if (std::string{out_vec.begin(), out_vec.end()} != out_str || out_str != out_ss_str) {
|
if (std::string{out_vec.begin(), out_vec.end()} != out_str || out_str != out_ss_str)
|
||||||
|
{
|
||||||
throw std::logic_error("Vector/stringstream/string results are not equal");
|
throw std::logic_error("Vector/stringstream/string results are not equal");
|
||||||
}
|
}
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user