Address PR comments

This commit is contained in:
Pepijn Schoen
2017-04-13 11:45:35 +02:00
committed by Patrick Niklaus
parent b830a8f942
commit 4929d1297e
4 changed files with 6 additions and 18 deletions
+4 -14
View File
@@ -67,7 +67,7 @@ int Contractor::Run()
std::vector<float> node_levels;
if (config.use_cached_priority)
{
ReadNodeLevels(node_levels);
files::readLevels(config.level_output_path, node_levels);
}
util::DeallocatingVector<QueryEdge> contracted_edge_list;
@@ -89,7 +89,9 @@ int Contractor::Run()
WriteCoreNodeMarker(std::move(is_core_node));
if (!config.use_cached_priority)
{
WriteNodeLevels(std::move(node_levels));
std::vector<float> out_node_levels(std::move(node_levels));
files::writeLevels(config.level_output_path, node_levels);
}
TIMER_STOP(preparing);
@@ -101,18 +103,6 @@ int Contractor::Run()
return 0;
}
void Contractor::ReadNodeLevels(std::vector<float> &node_levels) const
{
files::readLevels(config.level_output_path, node_levels);
}
void Contractor::WriteNodeLevels(std::vector<float> &&in_node_levels) const
{
std::vector<float> node_levels(std::move(in_node_levels));
files::writeLevels(config.level_output_path, node_levels);
}
void Contractor::WriteCoreNodeMarker(std::vector<bool> &&in_is_core_node) const
{
std::vector<bool> is_core_node(std::move(in_is_core_node));
+1 -1
View File
@@ -121,7 +121,7 @@ auto mmapFile(const std::string &filename, boost::interprocess::mode_t mode)
const file_mapping mapping{filename.c_str(), mode};
// map region started at an offset of util::FingerPrint size
mapped_region region{mapping, mode, 8};
mapped_region region{mapping, mode, sizeof(util::FingerPrint)};
region.advise(mapped_region::advice_sequential);
return region;
}