tpt_tokenindex.cc: Indentation.

This commit is contained in:
Ulrich Germann 2017-01-14 17:56:01 +00:00
parent 403fd9039e
commit 2e8bb0809b

View File

@ -59,8 +59,8 @@ namespace sapt
comp.base = reinterpret_cast<char const*>(endIdx);
if (!unkToken.empty())
{
Entry const* bla = lower_bound(startIdx,endIdx,unkToken.c_str(),comp);
unkId = ((bla < endIdx && unkToken == comp.base+bla->offset)
Entry const* bla = lower_bound(startIdx,endIdx,unkToken.c_str(),comp);
unkId = ((bla < endIdx && unkToken == comp.base+bla->offset)
? bla->id
: numTokens);
}
@ -98,10 +98,10 @@ namespace sapt
{
if (startIdx != endIdx)
{
Entry const* bla = lower_bound(startIdx,endIdx,p,comp);
if (bla != endIdx && !strcmp(comp.base+bla->offset,p))
return bla->id;
if (!dynamic) return unkId;
Entry const* bla = lower_bound(startIdx,endIdx,p,comp);
if (bla != endIdx && !strcmp(comp.base+bla->offset,p))
return bla->id;
if (!dynamic) return unkId;
}
else if (!dynamic) return strcmp(p,"NULL") && unkId;
@ -155,10 +155,10 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
// Someone else (multi-threading!) may have created the
// reverse index in the meantime, so let's check again
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
// Someone else (multi-threading!) may have created the
// reverse index in the meantime, so let's check again
if (!ridx.size()) ridx = reverseIndex();
}
if (id < ridx.size())
return ridx[id];
@ -175,8 +175,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
}
@ -187,8 +187,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
if (id < ridx.size())
return ridx[id];
@ -204,8 +204,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
ostringstream buf;
for (size_t i = 0; i < v.size(); i++)
@ -219,8 +219,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
ostringstream buf;
for (size_t i = 0; i < v.size(); i++)
@ -234,8 +234,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
ostringstream buf;
if (start < stop)
@ -251,8 +251,8 @@ namespace sapt
{
if (!ridx.size())
{
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
boost::lock_guard<boost::mutex> lk(*this->lock);
if (!ridx.size()) ridx = reverseIndex();
}
ostringstream buf;
if (start < stop)