Fields
| hardware | None |
| os | None |
Parameters
Fields
| Name | Value |
|---|
Parameters
| Name | Value |
|---|---|
| git_commit |
commit f1c341c36f1a8582163217196abf7401f81a4d2b Author: Peng Liu <winner245@hotmail.com> Date: Mon Nov 4 07:54:26 2024 -0500 [libc++] Refactor __split_buffer to eliminate code duplication (#114138) This PR refactors the `__split_buffer` class to eliminate code duplication in the `push_back` and `push_front` member functions. **Motivation:** The lvalue and rvalue reference overloads of `push_back` share identical logic, which coincides with that of `emplace_back`. Similarly, the overloads of `push_front` also share identical logic but lack an `emplace_front` member function, leading to an inconsistency. These identical internal logics lead to significant code duplication, making future maintenance more difficult. **Summary of Refactor:** This PR reduces code redundancy by: 1. Modifying both overloads of `push_back` to call `emplace_back`. 2. Introducing a new `emplace_front` member function that encapsulates the logic of `push_front`, allowing both overloads of `push_front` to call it (The addition of `emplace_front` also avoids the inconsistency regarding the absence of `emplace_front`). The refactoring results in reduced code duplication, improved maintainability, and enhanced readability. |