1
0
Fork 0

Removed const in AssocMulti batch insert. It was non-const casted internally...

This commit is contained in:
Michael Hackstein 2015-09-02 13:26:44 +02:00
parent 9001e88a89
commit 481cb1b7dd
3 changed files with 6 additions and 6 deletions

View File

@ -446,8 +446,8 @@ int EdgeIndex::remove (TRI_doc_mptr_t const* doc,
int EdgeIndex::batchInsert (std::vector<TRI_doc_mptr_t const*> const* documents, int EdgeIndex::batchInsert (std::vector<TRI_doc_mptr_t const*> const* documents,
size_t numThreads) { size_t numThreads) {
_edgesFrom->batchInsert(reinterpret_cast<std::vector<void const*> const*>(documents), numThreads); _edgesFrom->batchInsert(reinterpret_cast<std::vector<void*> const*>(documents), numThreads);
_edgesTo->batchInsert(reinterpret_cast<std::vector<void const*> const*>(documents), numThreads); _edgesTo->batchInsert(reinterpret_cast<std::vector<void*> const*>(documents), numThreads);
return TRI_ERROR_NO_ERROR; return TRI_ERROR_NO_ERROR;
} }

View File

@ -100,7 +100,7 @@ namespace triagens {
int remove (struct TRI_doc_mptr_t const*, bool) override final; int remove (struct TRI_doc_mptr_t const*, bool) override final;
int batchInsert (std::vector<struct TRI_doc_mptr_t const*> const*, int batchInsert (std::vector<TRI_doc_mptr_t const*> const*,
size_t) override final; size_t) override final;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////

View File

@ -387,14 +387,14 @@ namespace triagens {
/// @brief adds multiple elements to the array /// @brief adds multiple elements to the array
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
int batchInsert (std::vector<Element const*> const* data, int batchInsert (std::vector<Element*> const* data,
size_t numThreads) { size_t numThreads) {
#ifdef TRI_CHECK_MULTI_POINTER_HASH #ifdef TRI_CHECK_MULTI_POINTER_HASH
check(true, true); check(true, true);
#endif #endif
std::atomic<int> res(TRI_ERROR_NO_ERROR); std::atomic<int> res(TRI_ERROR_NO_ERROR);
std::vector<Element const*> const& elements = *(data); std::vector<Element*> const& elements = *(data);
if (elements.size() < numThreads) { if (elements.size() < numThreads) {
numThreads = elements.size(); numThreads = elements.size();
@ -428,7 +428,7 @@ namespace triagens {
it = partitions.emplace(bucketId, DocumentsPerBucket()).first; it = partitions.emplace(bucketId, DocumentsPerBucket()).first;
} }
(*it).second.emplace_back(std::make_pair(const_cast<Element*>(elements[i]), hashByKey)); (*it).second.emplace_back(std::make_pair(elements[i], hashByKey));
} }
// transfer ownership to the central map // transfer ownership to the central map