Skip to content

Commit

Permalink
Don't use construtor delegation
Browse files Browse the repository at this point in the history
  • Loading branch information
jboynes committed Nov 3, 2023
1 parent 21eb965 commit 5ba5010
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/CanMsg.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,11 @@ class CanMsg : public Printable

CanMsg() : CanMsg(0, 0, nullptr) { }

CanMsg(CanMsg const & other) : CanMsg(other.id, other.data_length, other.data) {
CanMsg(CanMsg const & other) {
id = other.id;
data_length = other.data_length;
if (data_length > 0)
memcpy(data, other.data, data_length);
}

virtual ~CanMsg() { }
Expand Down

0 comments on commit 5ba5010

Please sign in to comment.