Skip to content

Commit f494f17

Browse files
dongxinEricapkar
authored andcommitted
Remove the redundant error_state variable (#158)
1 parent d95f707 commit f494f17

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

src/QLContext.actor.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ struct IndexPlugin : ITDoc {
248248

249249
std::pair<bool, Reference<DocumentDeferred>> shouldDoUpdate(Reference<DocTransaction> tr,
250250
DataKey const& documentKey) {
251-
if (!error_state && documentKey.startsWith(collectionPath) && documentKey.size() > collectionPath.size()) {
251+
if (documentKey.startsWith(collectionPath) && documentKey.size() > collectionPath.size()) {
252252
std::string documentPrefix = documentKey.toString();
253253
auto info = tr->infos.find(documentPrefix);
254254
if (info == tr->infos.end())
@@ -292,7 +292,6 @@ struct IndexPlugin : ITDoc {
292292
DataKey collectionPath;
293293
DataKey indexPath;
294294
std::string indexName;
295-
bool error_state;
296295
bool multikey;
297296
bool isUniqueIndex;
298297
Optional<Reference<FlowLock>> flowControlLock;
@@ -301,7 +300,6 @@ struct IndexPlugin : ITDoc {
301300
: collectionPath(collectionPath),
302301
indexPath(indexInfo.indexCx->getPrefix()), // dbName+collectionName+"metadata"+"indices"+indexName
303302
ITDoc(next),
304-
error_state(false),
305303
multikey(indexInfo.multikey),
306304
isUniqueIndex(indexInfo.isUniqueIndex),
307305
indexName(indexInfo.indexName),
@@ -353,7 +351,6 @@ struct CompoundIndexPlugin : IndexPlugin, ReferenceCounted<CompoundIndexPlugin>,
353351
}
354352

355353
if (num_new_values > DOCLAYER_KNOBS->MULTI_MULTIKEY_INDEX_MAX) {
356-
self->error_state = true;
357354
throw multikey_index_cartesian_explosion();
358355
}
359356

@@ -520,7 +517,6 @@ struct SimpleIndexPlugin : IndexPlugin, ReferenceCounted<SimpleIndexPlugin>, Fas
520517
existing_index_entries.front().arena());
521518
if (existingDocId.compare(documentPath[documentPath.size() - 1])) {
522519
// existing index points to a different doc id that has the same value, abort.
523-
self->error_state = true;
524520
throw duplicated_key_field();
525521
}
526522
}

0 commit comments

Comments
 (0)