Review fixes.

This commit is contained in:
vng 2014-09-22 12:57:17 +03:00 committed by Alex Zolotarev
parent 34950be379
commit 3db180d470
4 changed files with 6 additions and 9 deletions

View file

@ -170,8 +170,6 @@ FileReader FilesMappingContainer::GetReader(Tag const & tag) const
return FileReader(m_name).SubReader(p->m_offset, p->m_size);
else
MYTHROW(Reader::OpenException, ("Can't find section:", tag));
return FileReader("xxx");
}
/////////////////////////////////////////////////////////////////////////////

View file

@ -7,6 +7,7 @@
#include "../base/assert.hpp"
#include "../base/logging.hpp"
#include "../base/math.hpp"
#include "../base/scope_guard.hpp"
#include "../std/fstream.hpp"
#include "../std/sstream.hpp"
@ -28,10 +29,8 @@ OsrmFtSegMapping::FtSeg::FtSeg(uint32_t fid, uint32_t ps, uint32_t pe)
}
OsrmFtSegMapping::FtSeg::FtSeg(uint64_t x)
: m_fid(x & 0xFFFFFFFF), m_pointStart(x >> 48), m_pointEnd((x >> 32) & 0xFFFF)
{
m_fid = x & 0xFFFFFFFF;
m_pointEnd = (x >> 32) & 0xFFFF;
m_pointStart = (x >> 48);
}
uint64_t OsrmFtSegMapping::FtSeg::Store() const
@ -264,12 +263,11 @@ void OsrmFtSegMappingBuilder::Save(FilesContainerW & cont) const
}
string const fName = cont.GetFileName() + "." ROUTING_FTSEG_FILE_TAG;
MY_SCOPE_GUARD(deleteFileGuard, bind(&FileWriter::DeleteFileX, cref(fName)));
succinct::elias_fano_compressed_list compressed(m_buffer);
succinct::mapper::freeze(compressed, fName.c_str());
cont.Write(fName, ROUTING_FTSEG_FILE_TAG);
FileWriter::DeleteFileX(fName);
}
}

View file

@ -27,6 +27,7 @@ public:
static constexpr uint32_t INVALID_FID = -1;
// No need to initialize something her (for vector<FtSeg>).
FtSeg() {}
FtSeg(uint32_t fid, uint32_t ps, uint32_t pe);

View file

@ -111,7 +111,7 @@ public:
}
};
}
} // namespace
OsrmRouter::OsrmRouter(Index const * index, CountryFileFnT const & fn)
@ -255,7 +255,7 @@ void OsrmRouter::CalculateRoute(m2::PointD const & startingPt, ReadyCallback con
auto correctFn = [&buffer] (SegT const & seg, size_t & ind)
{
auto it = find_if(buffer.begin(), buffer.end(), [&seg] (OsrmFtSegMapping::FtSeg const & s)
auto const it = find_if(buffer.begin(), buffer.end(), [&seg] (OsrmFtSegMapping::FtSeg const & s)
{
return s.IsIntersect(seg);
});