1
0
Fork 0
This commit is contained in:
jsteemann 2016-09-09 13:57:34 +02:00
parent 884b6d5d58
commit 1fcc5b18f7
1 changed files with 1 additions and 6 deletions

View File

@ -779,13 +779,8 @@ LogicalCollection::getIndexes() const {
// is somehow protected. If it goes out of all scopes
// or it's indexes are freed the pointer returned will get invalidated.
arangodb::PrimaryIndex* LogicalCollection::primaryIndex() const {
#ifdef ARANGODB_ENABLE_MAINTAINER_MODE
TRI_ASSERT(!_indexes.empty());
#else
if (_indexes.empty()) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_INTERNAL, "primary index not found");
}
#endif
TRI_ASSERT(_indexes[0]->type() == Index::IndexType::TRI_IDX_TYPE_PRIMARY_INDEX);
// the primary index must be the index at position #0
return static_cast<arangodb::PrimaryIndex*>(_indexes[0].get());
}