mirror of https://gitee.com/bigwinds/arangodb
moved magic number to function
This commit is contained in:
parent
81c68927aa
commit
d5200f26d7
|
@ -536,8 +536,8 @@ SkiplistIndex* SkiplistIndex_new (TRI_primary_collection_t* primary,
|
|||
skiplistIndex->_numFields = numFields;
|
||||
skiplistIndex->unique = unique;
|
||||
skiplistIndex->sparse = sparse;
|
||||
skiplistIndex->skiplist = TRI_InitSkipList(CmpElmElm,CmpKeyElm,skiplistIndex,
|
||||
FreeElm,unique);
|
||||
skiplistIndex->skiplist = TRI_InitSkipList(CmpElmElm, CmpKeyElm, skiplistIndex,
|
||||
FreeElm, unique);
|
||||
if (skiplistIndex->skiplist == NULL) {
|
||||
TRI_Free(TRI_CORE_MEM_ZONE, skiplistIndex);
|
||||
return NULL;
|
||||
|
|
|
@ -47,11 +47,6 @@ struct TRI_document_collection_s;
|
|||
// --SECTION-- public types
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief datafile attribute marker
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -75,19 +70,10 @@ typedef struct TRI_df_shape_marker_s {
|
|||
}
|
||||
TRI_df_shape_marker_t;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- constructors and destructors
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief creates a shaper
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -107,19 +93,10 @@ void TRI_DestroyVocShaper (TRI_shaper_t*);
|
|||
|
||||
void TRI_FreeVocShaper (TRI_shaper_t*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// --SECTION-- public functions
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @addtogroup VocBase
|
||||
/// @{
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief destroys a shaper, but does not free the pointer
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -182,10 +159,6 @@ int TRI_CompareShapeTypes (TRI_doc_mptr_t* leftDocument,
|
|||
TRI_shaper_t* leftShaper,
|
||||
TRI_shaper_t* rightShaper);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @}
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -505,6 +505,14 @@ TRI_shape_t* TRI_LookupBasicShapeShaper (TRI_shape_t const* shape) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns the first id for user-defined shapes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_shape_sid_t TRI_FirstCustomShapeIdShaper () {
|
||||
return 7;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief initialises global basic shape types
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -555,6 +563,8 @@ void TRI_InitialiseShaper () {
|
|||
shape->_type = TRI_SHAPE_LIST;
|
||||
shape->_dataSize = TRI_SHAPE_SIZE_VARIABLE;
|
||||
shape->_sid = BasicShapes._sidList = 6;
|
||||
|
||||
assert(shape->_sid + 1 == TRI_FirstCustomShapeIdShaper());
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -165,6 +165,12 @@ TRI_shape_t* TRI_LookupSidBasicShapeShaper (TRI_shape_sid_t);
|
|||
|
||||
TRI_shape_t* TRI_LookupBasicShapeShaper (TRI_shape_t const*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief returns the first id for user-defined shapes
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
TRI_shape_sid_t TRI_FirstCustomShapeIdShaper (void);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief initialises global basic shape types
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue