mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 05:21:25 +12:00
rsx: Use emplace when constructing in-place.
- Unexpectedly high gains for msvc builds. GCC doesn't care, clang shits itself.
This commit is contained in:
parent
1b8a69154f
commit
0bb8127372
2 changed files with 17 additions and 9 deletions
|
@ -138,6 +138,17 @@ namespace rsx
|
|||
_data[_size++] = val;
|
||||
}
|
||||
|
||||
template <typename... Args>
|
||||
void emplace_back(Args&&... args)
|
||||
{
|
||||
if (_size >= _capacity)
|
||||
{
|
||||
reserve(_capacity + 16);
|
||||
}
|
||||
|
||||
std::construct_at(&_data[_size++], std::forward<Args&&>(args)...);
|
||||
}
|
||||
|
||||
Ty pop_back()
|
||||
{
|
||||
return _data[--_size];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue