Pass-by-reference in YGNode::setStyle() ::setChildren() ::setLayout()

Summary: These shouldn't be copying the arguments when they pass by value. Instead these only get copied when assigning the value to the member.

Reviewed By: priteshrnandgaonkar

Differential Revision: D7291096

fbshipit-source-id: 7a4025831811d622050adbb5f86608855b94d68e
This commit is contained in:
Jonathan Dann
2018-03-21 16:05:09 -07:00
committed by Facebook Github Bot
parent 5d7b75a47a
commit cda328fa7e
2 changed files with 6 additions and 6 deletions

View File

@@ -225,11 +225,11 @@ void YGNode::setDirtiedFunc(YGDirtiedFunc dirtiedFunc) {
dirtied_ = dirtiedFunc;
}
void YGNode::setStyle(YGStyle style) {
void YGNode::setStyle(const YGStyle& style) {
style_ = style;
}
void YGNode::setLayout(YGLayout layout) {
void YGNode::setLayout(const YGLayout& layout) {
layout_ = layout;
}
@@ -241,7 +241,7 @@ void YGNode::setParent(YGNodeRef parent) {
parent_ = parent;
}
void YGNode::setChildren(YGVector children) {
void YGNode::setChildren(const YGVector& children) {
children_ = children;
}