mirror of https://gitee.com/bigwinds/arangodb
pull shapedJson creation out of loop
This commit is contained in:
parent
d31573a8b4
commit
4a8b4f5e73
|
@ -1499,6 +1499,7 @@ static int SkiplistIndexHelper(const TRI_skiplist_index_t* skiplistIndex,
|
||||||
TRI_skiplist_index_element_t* skiplistElement,
|
TRI_skiplist_index_element_t* skiplistElement,
|
||||||
const TRI_doc_mptr_t* document) {
|
const TRI_doc_mptr_t* document) {
|
||||||
TRI_shaped_json_t shapedObject;
|
TRI_shaped_json_t shapedObject;
|
||||||
|
TRI_shaped_json_t shapedJson;
|
||||||
TRI_shape_access_t const* acc;
|
TRI_shape_access_t const* acc;
|
||||||
char const* ptr;
|
char const* ptr;
|
||||||
size_t j;
|
size_t j;
|
||||||
|
@ -1508,15 +1509,23 @@ static int SkiplistIndexHelper(const TRI_skiplist_index_t* skiplistIndex,
|
||||||
// be retrieved later.
|
// be retrieved later.
|
||||||
// ..........................................................................
|
// ..........................................................................
|
||||||
|
|
||||||
|
assert(document != NULL);
|
||||||
|
assert(document->_data != NULL);
|
||||||
|
|
||||||
|
TRI_EXTRACT_SHAPED_JSON_MARKER(shapedJson, document->_data);
|
||||||
|
|
||||||
|
if (shapedJson._sid == 0) {
|
||||||
|
LOG_WARNING("encountered invalid marker with shape id 0");
|
||||||
|
|
||||||
|
return TRI_ERROR_INTERNAL;
|
||||||
|
}
|
||||||
|
|
||||||
skiplistElement->_document = CONST_CAST(document);
|
skiplistElement->_document = CONST_CAST(document);
|
||||||
ptr = (char const*) skiplistElement->_document->_data;
|
ptr = (char const*) skiplistElement->_document->_data;
|
||||||
|
|
||||||
for (j = 0; j < skiplistIndex->_paths._length; ++j) {
|
for (j = 0; j < skiplistIndex->_paths._length; ++j) {
|
||||||
TRI_shaped_json_t shapedJson;
|
|
||||||
TRI_shape_pid_t shape = *((TRI_shape_pid_t*)(TRI_AtVector(&skiplistIndex->_paths,j)));
|
TRI_shape_pid_t shape = *((TRI_shape_pid_t*)(TRI_AtVector(&skiplistIndex->_paths,j)));
|
||||||
|
|
||||||
TRI_EXTRACT_SHAPED_JSON_MARKER(shapedJson, document->_data);
|
|
||||||
|
|
||||||
// ..........................................................................
|
// ..........................................................................
|
||||||
// Determine if document has that particular shape
|
// Determine if document has that particular shape
|
||||||
// ..........................................................................
|
// ..........................................................................
|
||||||
|
|
Loading…
Reference in New Issue