1
0
Fork 0

Get rid of some TODOs and FIXMEs.

This commit is contained in:
Max Neunhoeffer 2014-10-29 11:25:30 +01:00
parent cfb26c8b0a
commit 59c1935466
7 changed files with 13 additions and 19 deletions

View File

@ -275,7 +275,7 @@ AqlItemBlock* AqlItemBlock::slice (size_t from,
TRI_ASSERT(from < to && to <= _nrItems);
std::unordered_map<AqlValue, AqlValue> cache;
// TODO: should we pre-reserve space for cache to avoid later re-allocations?
cache.reserve((to-from)*_nrRegs / 4 + 1);
AqlItemBlock* res = nullptr;
try {
@ -327,7 +327,7 @@ AqlItemBlock* AqlItemBlock::slice (std::vector<size_t>& chosen,
TRI_ASSERT(from < to && to <= chosen.size());
std::unordered_map<AqlValue, AqlValue> cache;
// TODO: should we pre-reserve space for cache to avoid later re-allocations?
cache.reserve((to-from)*_nrRegs / 4 + 1);
AqlItemBlock* res = nullptr;
try {

View File

@ -97,8 +97,9 @@ void AqlValue::destroy () {
// do nothing here, since data pointers need not be freed
break;
}
default: {
TRI_ASSERT(false);
case EMPTY: {
// do nothing
break;
}
}
@ -453,7 +454,7 @@ v8::Handle<v8::Value> AqlValue::toV8 (triagens::arango::AqlTransaction* trx,
}
case EMPTY: {
return v8::Object::New(); // TODO?
return v8::Undefined();
}
}
@ -506,7 +507,6 @@ Json AqlValue::toJson (triagens::arango::AqlTransaction* trx,
json(TRI_VOC_ATTRIBUTE_TO, Json(to));
}
// TODO: return _from and _to, and fix order of attributes!
return json;
}

View File

@ -693,7 +693,6 @@ TRI_json_t* AstNode::toJson (TRI_memory_zone_t* zone,
TRI_ASSERT(variable != nullptr);
/// TODO: use variable.toJson()!!!
TRI_Insert3ArrayJson(zone, node, "name", TRI_CreateStringCopyJson(zone, variable->name.c_str()));
TRI_Insert3ArrayJson(zone, node, "id", TRI_CreateNumberJson(zone, static_cast<double>(variable->id)));
}

View File

@ -84,7 +84,7 @@ void BindParameters::process () {
if (! TRI_IsStringJson(key)) {
// no string, should not happen
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_BIND_PARAMETER_TYPE); // TODO: add parameter name
THROW_ARANGO_EXCEPTION(TRI_ERROR_QUERY_BIND_PARAMETER_TYPE);
}
std::string const k(key->_value._string.data, key->_value._string.length - 1);

View File

@ -2924,8 +2924,6 @@ int ModificationBlock::extractKey (AqlValue const& value,
if (value.isArray()) {
Json member(value.extractArrayMember(_trx, document, TRI_VOC_ATTRIBUTE_KEY));
// TODO: allow _id, too
TRI_json_t const* json = member.json();
if (TRI_IsStringJson(json)) {
key = std::string(json->_value._string.data, json->_value._string.length - 1);

View File

@ -1365,7 +1365,7 @@ class SortToIndexNode : public WalkerWorker<ExecutionNode> {
node->vocbase(),
node->collection(),
node->outVariable(),
idx.index, /// TODO: estimate cost on match quality
idx.index,
result.second,
(idx.doesMatch && idx.reverse));
newPlan->registerNode(newNode);
@ -1397,7 +1397,7 @@ class SortToIndexNode : public WalkerWorker<ExecutionNode> {
switch (en->getType()) {
case EN::ENUMERATE_LIST:
case EN::CALCULATION:
case EN::SUBQUERY: /// TODO: find out whether it may throw
case EN::SUBQUERY:
case EN::FILTER:
return false; // skip. we don't care.
@ -1439,9 +1439,9 @@ int triagens::aql::useIndexForSort (Optimizer* opt,
for (auto n : nodes) {
auto thisSortNode = static_cast<SortNode*>(n);
SortAnalysis node(thisSortNode);
if (node.isAnalyzeable()) {
if (node.isAnalyzeable() && ! n->getDependencies().empty()) {
SortToIndexNode finder(opt, plan, &node, rule->level);
thisSortNode->walk(&finder);/// todo auf der dependency anfangen
thisSortNode->getDependencies()[0]->walk(&finder);
if (finder.planModified) {
planModified = true;
}
@ -2174,8 +2174,6 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
}
auto cn = static_cast<CalculationNode*>(en);
auto fn = static_cast<FilterNode*>(_lastNode);
// FIXME should the following be an assertion? I.e. can it
// ever happen?
// check these are a Calc-Filter pair
if (cn->getVariablesSetHere()[0]->id != fn->getVariablesUsedHere()[0]->id) {
@ -2190,7 +2188,7 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
break; //abort . . .
}
if (varsUsedHere[0]->id != _variable->id) {
break; // abort . . . FIXME is this the desired behaviour??
break;
}
_lastNode = en;
return false; // continue . . .
@ -2200,7 +2198,7 @@ class RemoveToEnumCollFinder: public WalkerWorker<ExecutionNode> {
// and that we have already seen a remove node
TRI_ASSERT(_enumColl != nullptr);
if (en->id() != _enumColl->id()) {
break; // abort . . . FIXME is this the desired behaviour??
break;
}
return true; // reached the end!
}

View File

@ -498,7 +498,6 @@ void RestAqlHandler::getInfoQuery (std::string const& operation,
try {
int64_t number;
if (operation == "count") {
//TODO shardId.empty()!
number = query->engine()->count();
if (number == -1) {
answerBody("count", Json("unknown"));