1
0
Fork 0

removed unused cases

This commit is contained in:
Jan Steemann 2015-09-02 17:16:40 +02:00
parent 282e13afb4
commit 62b4a165b3
4 changed files with 22 additions and 18 deletions

View File

@ -67,9 +67,7 @@ TRI_index_operator_t* TRI_CreateIndexOperator (TRI_index_operator_type_e operato
VocShaper* shaper, VocShaper* shaper,
size_t numFields) { size_t numFields) {
switch (operatorType) { switch (operatorType) {
case TRI_AND_INDEX_OPERATOR: case TRI_AND_INDEX_OPERATOR: {
case TRI_NOT_INDEX_OPERATOR:
case TRI_OR_INDEX_OPERATOR: {
return new TRI_logical_index_operator_t(operatorType, shaper, leftOperand, rightOperand); return new TRI_logical_index_operator_t(operatorType, shaper, leftOperand, rightOperand);
} }

View File

@ -87,9 +87,7 @@ typedef enum {
TRI_GE_INDEX_OPERATOR, TRI_GE_INDEX_OPERATOR,
TRI_GT_INDEX_OPERATOR, TRI_GT_INDEX_OPERATOR,
TRI_AND_INDEX_OPERATOR, TRI_AND_INDEX_OPERATOR
TRI_NOT_INDEX_OPERATOR,
TRI_OR_INDEX_OPERATOR
} }
TRI_index_operator_type_e; TRI_index_operator_type_e;

View File

@ -128,9 +128,7 @@ static int FillLookupOperator (TRI_index_operator_t* slOperator,
} }
switch (slOperator->_type) { switch (slOperator->_type) {
case TRI_AND_INDEX_OPERATOR: case TRI_AND_INDEX_OPERATOR: {
case TRI_NOT_INDEX_OPERATOR:
case TRI_OR_INDEX_OPERATOR: {
TRI_logical_index_operator_t* logicalOperator = (TRI_logical_index_operator_t*) slOperator; TRI_logical_index_operator_t* logicalOperator = (TRI_logical_index_operator_t*) slOperator;
int res = FillLookupOperator(logicalOperator->_left, document); int res = FillLookupOperator(logicalOperator->_left, document);

View File

@ -38,10 +38,6 @@
#include "VocBase/vocbase.h" #include "VocBase/vocbase.h"
#include "VocBase/voc-types.h" #include "VocBase/voc-types.h"
// -----------------------------------------------------------------------------
// --SECTION-- class SkiplistIndex
// -----------------------------------------------------------------------------
typedef struct { typedef struct {
TRI_shaped_json_t* _fields; // list of shaped json objects which the TRI_shaped_json_t* _fields; // list of shaped json objects which the
// collection should know about // collection should know about
@ -65,12 +61,17 @@ namespace triagens {
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
class SkiplistIterator { class SkiplistIterator {
private: private:
friend class SkiplistIndex; friend class SkiplistIndex;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- private structs // --SECTION-- private structs
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
private:
// Shorthand for the skiplist node // Shorthand for the skiplist node
typedef triagens::basics::SkipListNode<TRI_skiplist_index_key_t, TRI_index_element_t> Node; typedef triagens::basics::SkipListNode<TRI_skiplist_index_key_t, TRI_index_element_t> Node;
@ -86,17 +87,20 @@ namespace triagens {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- private variables // --SECTION-- private variables
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
private:
SkiplistIndex* const _index; SkiplistIndex* const _index;
size_t _currentInterval; // starts with 0, current interval used size_t _currentInterval; // starts with 0, current interval used
bool _reverse; bool _reverse;
Node* _cursor; Node* _cursor;
std::vector<SkiplistIteratorInterval> _intervals; std::vector<SkiplistIteratorInterval> _intervals;
public:
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- constructors / destructors // --SECTION-- constructors / destructors
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
public:
SkiplistIterator ( SkiplistIterator (
SkiplistIndex* const idx, SkiplistIndex* const idx,
@ -124,6 +128,8 @@ namespace triagens {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- public methods // --SECTION-- public methods
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
public:
size_t size (); size_t size ();
@ -137,6 +143,7 @@ namespace triagens {
TRI_index_operator_t const* indexOperator, TRI_index_operator_t const* indexOperator,
std::vector<SkiplistIteratorInterval>& interval std::vector<SkiplistIteratorInterval>& interval
); );
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- private methods // --SECTION-- private methods
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -160,6 +167,10 @@ namespace triagens {
); );
}; };
// -----------------------------------------------------------------------------
// --SECTION-- class SkiplistIndex
// -----------------------------------------------------------------------------
class SkiplistIndex : public PathBasedIndex { class SkiplistIndex : public PathBasedIndex {
struct KeyElementComparator { struct KeyElementComparator {
@ -193,8 +204,8 @@ namespace triagens {
friend struct KeyElementComparator; friend struct KeyElementComparator;
friend struct ElementElementComparator; friend struct ElementElementComparator;
typedef triagens::basics::SkipList<TRI_skiplist_index_key_t, TRI_index_element_t> TRI_Skiplist; typedef triagens::basics::SkipList<TRI_skiplist_index_key_t, TRI_index_element_t> TRI_Skiplist;
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- constructors / destructors // --SECTION-- constructors / destructors
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -246,7 +257,6 @@ namespace triagens {
SkiplistIterator* lookup (TRI_index_operator_t*, bool); SkiplistIterator* lookup (TRI_index_operator_t*, bool);
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- private methods // --SECTION-- private methods
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -263,7 +273,6 @@ namespace triagens {
int _CmpKeyElm (TRI_skiplist_index_key_t const* leftKey, int _CmpKeyElm (TRI_skiplist_index_key_t const* leftKey,
TRI_index_element_t const* rightElement); TRI_index_element_t const* rightElement);
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// --SECTION-- private variables // --SECTION-- private variables
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
@ -271,6 +280,7 @@ namespace triagens {
private: private:
ElementElementComparator CmpElmElm; ElementElementComparator CmpElmElm;
KeyElementComparator CmpKeyElm; KeyElementComparator CmpKeyElm;
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////