summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx')
-rw-r--r--src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx b/src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx
index 03de6947a86..5a828f865f5 100644
--- a/src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx
+++ b/src/third_party/wiredtiger/test/cppsuite/tests/hs_cleanup.cxx
@@ -91,14 +91,13 @@ class hs_cleanup : public test {
* API doesn't guarantee our buffer will still be valid once it is called, as such we
* copy the buffer and then pass it into the API.
*/
- bool rollback_required = tc->update(cursor, coll.id, key_value_t(key_tmp));
-
- /* Commit our transaction. */
- if (!rollback_required && tc->transaction.can_commit())
- rollback_required = tc->transaction.commit();
-
- if (rollback_required)
+ if (tc->update(cursor, coll.id, key_value_t(key_tmp))) {
+ if (tc->transaction.can_commit()) {
+ tc->transaction.commit();
+ }
+ } else {
tc->transaction.rollback();
+ }
}
/* Ensure our last transaction is resolved. */
if (tc->transaction.active())