include/nodejs/node_osrm.hpp: clang-format

This commit is contained in:
Łukasz Jagielski 2020-05-12 15:09:40 +02:00
parent 7d369b9ab9
commit cbec111eb6
2 changed files with 9 additions and 9 deletions

View File

@ -37,7 +37,7 @@ struct Engine final : public Nan::ObjectWrap
std::shared_ptr<osrm::OSRM> this_;
};
} // ns node_osrm
} // namespace node_osrm
NODE_MODULE(osrm, node_osrm::Engine::Init)

View File

@ -116,8 +116,8 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
if (args[0]->IsString())
{
engine_config->storage_config = osrm::StorageConfig(
*Nan::Utf8String(Nan::To<v8::String>(args[0]).ToLocalChecked()));
engine_config->storage_config =
osrm::StorageConfig(*Nan::Utf8String(Nan::To<v8::String>(args[0]).ToLocalChecked()));
engine_config->use_shared_memory = false;
return engine_config;
}
@ -292,8 +292,7 @@ inline engine_config_ptr argumentsToEngineConfig(const Nan::FunctionCallbackInfo
if (max_locations_trip->IsNumber())
engine_config->max_locations_trip = Nan::To<int>(max_locations_trip).FromJust();
if (max_locations_viaroute->IsNumber())
engine_config->max_locations_viaroute =
Nan::To<int>(max_locations_viaroute).FromJust();
engine_config->max_locations_viaroute = Nan::To<int>(max_locations_viaroute).FromJust();
if (max_locations_distance_table->IsNumber())
engine_config->max_locations_distance_table =
Nan::To<int>(max_locations_distance_table).FromJust();
@ -537,7 +536,8 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
return false;
}
params->bearings.push_back(osrm::Bearing{static_cast<short>(bearing), static_cast<short>(range)});
params->bearings.push_back(
osrm::Bearing{static_cast<short>(bearing), static_cast<short>(range)});
}
else
{
@ -587,8 +587,7 @@ inline bool argumentsToParameter(const Nan::FunctionCallbackInfo<v8::Value> &arg
return false;
}
params->hints.push_back(
osrm::engine::Hint::FromBase64(*Nan::Utf8String(hint)));
params->hints.push_back(osrm::engine::Hint::FromBase64(*Nan::Utf8String(hint)));
}
else if (hint->IsNull())
{
@ -1582,7 +1581,8 @@ argumentsToMatchParameter(const Nan::FunctionCallbackInfo<v8::Value> &args,
Nan::ThrowError("Waypoints must correspond with the index of an input coordinate");
return match_parameters_ptr();
}
params->waypoints.emplace_back(static_cast<unsigned>(Nan::To<unsigned>(waypoint_value).FromJust()));
params->waypoints.emplace_back(
static_cast<unsigned>(Nan::To<unsigned>(waypoint_value).FromJust()));
}
}