1
0
Fork 0

indenting

This commit is contained in:
Jan Steemann 2013-06-21 21:24:42 +02:00
parent 4c716aee0e
commit d2a0d17c2a
1 changed files with 36 additions and 24 deletions

View File

@ -434,12 +434,15 @@ bool IsSameReference (const TRI_aql_field_access_t* const lhs,
if (lhs->_value._reference._type == TRI_AQL_REFERENCE_VARIABLE && if (lhs->_value._reference._type == TRI_AQL_REFERENCE_VARIABLE &&
rhs->_value._reference._type == TRI_AQL_REFERENCE_VARIABLE) { rhs->_value._reference._type == TRI_AQL_REFERENCE_VARIABLE) {
return TRI_EqualString(lhs->_value._reference._ref._name, rhs->_value._reference._ref._name); return TRI_EqualString(lhs->_value._reference._ref._name,
rhs->_value._reference._ref._name);
} }
if (lhs->_value._reference._type == TRI_AQL_REFERENCE_ATTRIBUTE_ACCESS && if (lhs->_value._reference._type == TRI_AQL_REFERENCE_ATTRIBUTE_ACCESS &&
rhs->_value._reference._type == TRI_AQL_REFERENCE_ATTRIBUTE_ACCESS) { rhs->_value._reference._type == TRI_AQL_REFERENCE_ATTRIBUTE_ACCESS) {
return TRI_EqualString(lhs->_fullName, rhs->_fullName);
return TRI_EqualString(lhs->_fullName,
rhs->_fullName);
} }
return false; return false;
@ -1174,6 +1177,7 @@ static TRI_aql_field_access_t* MergeAndReference (TRI_aql_context_t* const conte
if (! isSameAttribute) { if (! isSameAttribute) {
// different attribute names are referred to. we can return either // different attribute names are referred to. we can return either
TRI_FreeAccessAql(rhs); TRI_FreeAccessAql(rhs);
return lhs; return lhs;
} }
@ -1187,13 +1191,15 @@ static TRI_aql_field_access_t* MergeAndReference (TRI_aql_context_t* const conte
return lhs; return lhs;
} }
if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT && rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE) { if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT &&
rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE) {
// < && <=, merge to < // < && <=, merge to <
TRI_FreeAccessAql(rhs); TRI_FreeAccessAql(rhs);
return lhs; return lhs;
} }
if (rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT && lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE) { if (rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT &&
lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE) {
// <= && <, merge to < // <= && <, merge to <
TRI_FreeAccessAql(lhs); TRI_FreeAccessAql(lhs);
@ -1215,7 +1221,8 @@ static TRI_aql_field_access_t* MergeAndReference (TRI_aql_context_t* const conte
possible = false; possible = false;
} }
else if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT && else if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT &&
(rhsType == TRI_AQL_NODE_OPERATOR_BINARY_GE || rhsType == TRI_AQL_NODE_OPERATOR_BINARY_GT)) { (rhsType == TRI_AQL_NODE_OPERATOR_BINARY_GE ||
rhsType == TRI_AQL_NODE_OPERATOR_BINARY_GT)) {
// lhs < ref && (lhs >= ref || lhs > ref) => impossible // lhs < ref && (lhs >= ref || lhs > ref) => impossible
possible = false; possible = false;
} }
@ -1225,7 +1232,8 @@ static TRI_aql_field_access_t* MergeAndReference (TRI_aql_context_t* const conte
possible = false; possible = false;
} }
else if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_GT && else if (lhsType == TRI_AQL_NODE_OPERATOR_BINARY_GT &&
(rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE || rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT)) { (rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LE ||
rhsType == TRI_AQL_NODE_OPERATOR_BINARY_LT)) {
// lhs > ref && (lhs <= ref || lhs < ref) => impossible // lhs > ref && (lhs <= ref || lhs < ref) => impossible
possible = false; possible = false;
} }
@ -1246,11 +1254,13 @@ static TRI_aql_field_access_t* MergeAndReference (TRI_aql_context_t* const conte
// everything else results in lhs // everything else results in lhs
TRI_FreeAccessAql(rhs); TRI_FreeAccessAql(rhs);
return lhs; return lhs;
} }
if (rhs->_type == TRI_AQL_ACCESS_ALL) { if (rhs->_type == TRI_AQL_ACCESS_ALL) {
TRI_FreeAccessAql(rhs); TRI_FreeAccessAql(rhs);
return lhs; return lhs;
} }
@ -2161,6 +2171,7 @@ static TRI_aql_field_access_t* CreateAccessForNode (TRI_aql_context_t* const con
return NULL; return NULL;
} }
SetNameLength(fieldAccess); SetNameLength(fieldAccess);
if (operator == TRI_AQL_NODE_OPERATOR_BINARY_NE) { if (operator == TRI_AQL_NODE_OPERATOR_BINARY_NE) {
@ -2175,6 +2186,7 @@ static TRI_aql_field_access_t* CreateAccessForNode (TRI_aql_context_t* const con
// create the reference access // create the reference access
fieldAccess->_type = TRI_AQL_ACCESS_REFERENCE; fieldAccess->_type = TRI_AQL_ACCESS_REFERENCE;
fieldAccess->_value._reference._operator = operator; fieldAccess->_value._reference._operator = operator;
if (node->_type == TRI_AQL_NODE_REFERENCE) { if (node->_type == TRI_AQL_NODE_REFERENCE) {
fieldAccess->_value._reference._type = TRI_AQL_REFERENCE_VARIABLE; fieldAccess->_value._reference._type = TRI_AQL_REFERENCE_VARIABLE;
fieldAccess->_value._reference._ref._name = TRI_AQL_NODE_STRING(node); fieldAccess->_value._reference._ref._name = TRI_AQL_NODE_STRING(node);