mirror of
https://github.com/zeek/zeek.git
synced 2025-10-16 05:28:20 +00:00
Merge remote-tracking branch 'origin/topic/johanna/remove-build-unique'
* origin/topic/johanna/remove-build-unique: Replace build_unique with make_unique
This commit is contained in:
commit
7b9a27c96a
6 changed files with 21 additions and 14 deletions
|
@ -1,5 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "OpaqueVal.h"
|
||||
#include "NetVar.h"
|
||||
#include "Reporter.h"
|
||||
|
@ -1073,7 +1075,7 @@ bool ParaglobVal::DoUnserialize(const broker::data& data)
|
|||
|
||||
try
|
||||
{
|
||||
this->internal_paraglob = build_unique<paraglob::Paraglob>(std::move(iv));
|
||||
this->internal_paraglob = std::make_unique<paraglob::Paraglob>(std::move(iv));
|
||||
}
|
||||
catch (const paraglob::underflow_error& e)
|
||||
{
|
||||
|
@ -1093,7 +1095,7 @@ Val* ParaglobVal::DoClone(CloneState* state)
|
|||
{
|
||||
try {
|
||||
return new ParaglobVal
|
||||
(build_unique<paraglob::Paraglob>(this->internal_paraglob->serialize()));
|
||||
(std::make_unique<paraglob::Paraglob>(this->internal_paraglob->serialize()));
|
||||
}
|
||||
catch (const paraglob::underflow_error& e)
|
||||
{
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
// See the file "COPYING" in the main distribution directory for copyright.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "zeek-config.h"
|
||||
|
||||
#include "Var.h"
|
||||
|
@ -510,7 +512,7 @@ void end_func(Stmt* body)
|
|||
|
||||
std::unique_ptr<function_ingredients> gather_function_ingredients(Scope* scope, Stmt* body)
|
||||
{
|
||||
auto ingredients = build_unique<function_ingredients>();
|
||||
auto ingredients = std::make_unique<function_ingredients>();
|
||||
|
||||
ingredients->frame_size = scope->Length();
|
||||
ingredients->inits = scope->GetInits();
|
||||
|
|
|
@ -563,15 +563,6 @@ void bro_strerror_r(int bro_errno, char* buf, size_t buflen);
|
|||
*/
|
||||
char* zeekenv(const char* name);
|
||||
|
||||
/**
|
||||
* Small convenience function. Does what std::make_unique does in C++14. Will not
|
||||
* work on arrays.
|
||||
*/
|
||||
template <typename T, typename ... Args>
|
||||
std::unique_ptr<T> build_unique (Args&&... args) {
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
/**
|
||||
* Escapes bytes in a string that are not valid UTF8 characters with \xYY format. Used
|
||||
* by the JSON writer and BIF methods.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue