mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Simplify some copy_string() usages in threading::Field
This commit is contained in:
parent
ff90236df3
commit
6946cffde2
3 changed files with 17 additions and 7 deletions
10
CHANGES
10
CHANGES
|
@ -1,4 +1,14 @@
|
|||
|
||||
4.1.0-dev.284 | 2021-03-05 17:37:03 -0800
|
||||
|
||||
* Simplify some copy_string() usages in threading::Field (Jon Siwek, Corelight)
|
||||
|
||||
* Use const-reference in plugin::Manager::MetaHookPost for minor performance gain (Tim Wojtulewicz, Corelight)
|
||||
|
||||
* Fix missing assigmnent operator/copy constructor pairings reported by LGTM (Tim Wojtulewicz, Corelight)
|
||||
|
||||
* Fix variable shadowing issues reported by LGTM (Tim Wojtulewicz, Corelight)
|
||||
|
||||
4.1.0-dev.277 | 2021-03-05 16:14:23 -0800
|
||||
|
||||
* Avoid reporting paths repeatedly in zeek-config --include_dir (Christian Kreibich, Corelight)
|
||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
4.1.0-dev.277
|
||||
4.1.0-dev.284
|
||||
|
|
|
@ -29,16 +29,16 @@ struct Field {
|
|||
* Constructor.
|
||||
*/
|
||||
Field(const char* name, const char* secondary_name, TypeTag type, TypeTag subtype, bool optional)
|
||||
: name(name ? util::copy_string(name) : nullptr),
|
||||
secondary_name(secondary_name ? util::copy_string(secondary_name) : nullptr),
|
||||
: name(util::copy_string(name)),
|
||||
secondary_name(util::copy_string(secondary_name)),
|
||||
type(type), subtype(subtype), optional(optional) { }
|
||||
|
||||
/**
|
||||
* Copy constructor.
|
||||
*/
|
||||
Field(const Field& other)
|
||||
: name(other.name ? util::copy_string(other.name) : nullptr),
|
||||
secondary_name(other.secondary_name ? util::copy_string(other.secondary_name) : nullptr),
|
||||
: name(util::copy_string(other.name)),
|
||||
secondary_name(util::copy_string(other.secondary_name)),
|
||||
type(other.type), subtype(other.subtype), optional(other.optional) { }
|
||||
|
||||
~Field()
|
||||
|
@ -53,8 +53,8 @@ struct Field {
|
|||
{
|
||||
delete [] name;
|
||||
delete [] secondary_name;
|
||||
name = other.name ? util::copy_string(other.name) : nullptr;
|
||||
secondary_name = other.secondary_name ? util::copy_string(other.secondary_name) : nullptr;
|
||||
name = util::copy_string(other.name);
|
||||
secondary_name = util::copy_string(other.secondary_name);
|
||||
type = other.type;
|
||||
subtype = other.subtype;
|
||||
optional = other.optional;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue