Skip to content

Conversation

@laurynas-biveinis
Copy link
Contributor

This saves one level of indirection and an extra heap allocation.

  • Rdb_writebatch_impl: remove pointer from m_batch field, make is_tx_started
    return true instead of checking the pointer, remove pointer check from
    rollback_stmt, remove new/delete from the constructor and the destructor.
  • Make Rdb_dict_manager::begin return object directly instead of a unique_ptr
    and make this method static.
  • In the affected callstacks, replace WriteBatchBase / WriteBatch pointer
    arguments with reference ones, remove an unused error return from
    Rdb_dict_manager::commit and any "!= nullptr" assertions.
  • Rdb_transaction: change get_write_batch return type to WriteBatchBase
    reference instead of a pointer.
  • Add [[nodiscard]] to touched methods, although not universally, as several
    methods have their return values ignored. Remove redundant const from by-value
    parameters.
…ng object

This saves one level of indirection and an extra heap allocation.

- Rdb_writebatch_impl: remove pointer from m_batch field, make is_tx_started
  return true instead of checking the pointer, remove pointer check from
  rollback_stmt, remove new/delete from the constructor and the destructor.
- Make Rdb_dict_manager::begin return object directly instead of a unique_ptr
  and make this method static.
- In the affected callstacks, replace WriteBatchBase / WriteBatch pointer
  arguments with reference ones, remove an unused error return from
  Rdb_dict_manager::commit and any "!= nullptr" assertions.
- Rdb_transaction: change get_write_batch return type to WriteBatchBase
  reference instead of a pointer.
- Add [[nodiscard]] to touched methods, although not universally, as several
  methods have their return values ignored. Remove redundant const from by-value
  parameters.
@facebook-github-bot
Copy link

@luqun has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link

This pull request has been merged in ebcd17e.

@laurynas-biveinis laurynas-biveinis deleted the myr-cleanup-trx branch September 11, 2024 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants