ExportXMLWordPrintableJSON

    • Type: Technical Debt
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Test Model
    • None
    • Storage Engines - Persistence
    • 129.06
    • StorEng - Defined Pipeline
    • None

      Context

      In C++, a

      std::shared_ptr<T>

      implicitly converts to

      T&

      via

      operator*

      , so writing

      *ptr.get()

      is equivalent to

      *ptr

      . The explicit

      .get()

      is redundant and obscures intent.

      While reviewing #14797 (WT-12891), the

      .get()

      calls that PR introduced or could have dropped were cleaned up. A handful of identical pre-existing patterns remain in test/model. This ticket tracks removing them.

      Work to do

      Replace the redundant

      *x.get()

      with

      *x

      at these sites (line numbers are as of PR #14797's head; re-check against develop after it merges):

      test/model/src/driver/kv_workload_generator.cpp:116
          _workload(*(_workload_ptr.get()))  ->  _workload(*_workload_ptr)
      
      test/model/src/driver/kv_workload_generator.cpp:199
          _barrier_fn(*seq.get())  ->  _barrier_fn(*seq)
      
      test/model/src/driver/kv_workload_generator.cpp:421
          *txn_ptr.get()  ->  *txn_ptr
      
      test/model/src/include/model/driver/kv_workload.h:1633
          out << *workload.get();  ->  out << *workload;
      

      Out of scope

      These

      .get()

      calls genuinely need the raw pointer and must be left alone:

      kv_workload_generator.cpp:154   _per_sequence_state.emplace(seq.get(), ...)   (raw pointer as map key / ctor arg)
      test/model/src/core/verify.cpp:99   make_pair(i->first, i->second.get())       (raw pointer into the pair)
      kv_workload_sequence.h:219      must_finish_before(other.get())               (shared_ptr overload delegating to the raw-pointer version)
      

      Definition of done

      • All four sites above use
        *x

        instead of

        *x.get()

        .

      • test/model builds (cppsuite/model target) and the model tests still pass.

            Assignee:
            [DO NOT USE] Backlog - Storage Engines Team
            Reporter:
            Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: