mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2025-11-29 17:38:24 +08:00
refactor(Core/Misc): add braces and impove codestyle (#6402)
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
#include <vector>
|
||||
|
||||
template <typename T>
|
||||
class CircularBuffer {
|
||||
class CircularBuffer
|
||||
{
|
||||
public:
|
||||
explicit CircularBuffer(size_t size) :
|
||||
buf_(std::unique_ptr<T[]>(new T[size])),
|
||||
@@ -77,13 +78,15 @@ public:
|
||||
|
||||
// the implementation of this function is simplified by the fact that head_ will never be lower than tail_
|
||||
// when compared to the original implementation of this class
|
||||
std::vector<T> content() {
|
||||
std::vector<T> content()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
|
||||
return std::vector<T>(buf_.get(), buf_.get() + size());
|
||||
}
|
||||
|
||||
T peak_back() {
|
||||
T peak_back()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
|
||||
return empty() ? T() : buf_[tail_];
|
||||
|
||||
Reference in New Issue
Block a user