Address PR comment by @oxidase
This commit is contained in:
parent
260a84b94b
commit
ffd6311e7d
@ -41,11 +41,8 @@ void write(const boost::filesystem::path &path, const SegmentDataContainer &segm
|
||||
const auto fingerprint = storage::io::FileWriter::HasNoFingerprint;
|
||||
storage::io::FileWriter writer{path, fingerprint};
|
||||
|
||||
// FIXME this _should_ just be size and the senitel below need to be removed
|
||||
writer.WriteElementCount32(segment_data.index.size() + 1);
|
||||
writer.WriteFrom(segment_data.index.data(), segment_data.index.size());
|
||||
// FIMXE remove unnecessary senitel
|
||||
writer.WriteElementCount32(segment_data.nodes.size());
|
||||
writer.WriteElementCount32(segment_data.index.size());
|
||||
writer.WriteFrom(segment_data.index);
|
||||
|
||||
writer.WriteElementCount32(segment_data.nodes.size());
|
||||
writer.WriteFrom(segment_data.nodes);
|
||||
|
@ -284,7 +284,10 @@ class FileWriter
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T> void WriteFrom(const std::vector<T> &src) { WriteFrom(src.data(), src.size()); }
|
||||
template <typename T> void WriteFrom(const std::vector<T> &src)
|
||||
{
|
||||
WriteFrom(src.data(), src.size());
|
||||
}
|
||||
|
||||
template <typename T> void WriteFrom(const T &src) { WriteFrom(&src, 1); }
|
||||
|
||||
|
@ -330,6 +330,9 @@ NodeID CompressedEdgeContainer::GetLastEdgeSourceID(const EdgeID edge_id) const
|
||||
|
||||
std::unique_ptr<SegmentDataContainer> CompressedEdgeContainer::ToSegmentData()
|
||||
{
|
||||
// Finalize the index
|
||||
segment_data->index.push_back(segment_data->nodes.size());
|
||||
|
||||
return std::move(segment_data);
|
||||
}
|
||||
}
|
||||
|
@ -116,6 +116,7 @@ void GetNewWeight(const UpdaterConfig &config,
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(NDEBUG)
|
||||
void CheckWeightsConsistency(
|
||||
const UpdaterConfig &config,
|
||||
const std::vector<osrm::extractor::EdgeBasedEdge> &edge_based_edge_list)
|
||||
@ -159,19 +160,18 @@ void CheckWeightsConsistency(
|
||||
BOOST_ASSERT(weight <= edge.data.weight);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
EdgeID
|
||||
Updater::LoadAndUpdateEdgeExpandedGraph(std::vector<extractor::EdgeBasedEdge> &edge_based_edge_list,
|
||||
std::vector<EdgeWeight> &node_weights) const
|
||||
{
|
||||
double weight_multiplier = 10;
|
||||
|
||||
// Propagate profile properties to contractor configuration structure
|
||||
extractor::ProfileProperties profile_properties;
|
||||
storage::io::FileReader profile_properties_file(config.profile_properties_path,
|
||||
storage::io::FileReader::HasNoFingerprint);
|
||||
profile_properties_file.ReadInto<extractor::ProfileProperties>(&profile_properties, 1);
|
||||
weight_multiplier = profile_properties.GetWeightMultiplier();
|
||||
auto weight_multiplier = profile_properties.GetWeightMultiplier();
|
||||
|
||||
if (config.segment_speed_lookup_paths.size() + config.turn_penalty_lookup_paths.size() > 255)
|
||||
throw util::exception("Limit of 255 segment speed and turn penalty files each reached" +
|
||||
|
Loading…
Reference in New Issue
Block a user