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:
committed by
Facebook Github Bot
parent
5d7b75a47a
commit
cda328fa7e
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -106,13 +106,13 @@ struct YGNode {
|
||||
void setMeasureFunc(YGMeasureFunc measureFunc);
|
||||
void setBaseLineFunc(YGBaselineFunc baseLineFunc);
|
||||
void setDirtiedFunc(YGDirtiedFunc dirtiedFunc);
|
||||
void setStyle(YGStyle style);
|
||||
void setStyle(const YGStyle& style);
|
||||
void setStyleFlexDirection(YGFlexDirection direction);
|
||||
void setStyleAlignContent(YGAlign alignContent);
|
||||
void setLayout(YGLayout layout);
|
||||
void setLayout(const YGLayout& layout);
|
||||
void setLineIndex(uint32_t lineIndex);
|
||||
void setParent(YGNodeRef parent);
|
||||
void setChildren(YGVector children);
|
||||
void setChildren(const YGVector& children);
|
||||
void setNextChild(YGNodeRef nextChild);
|
||||
void setConfig(YGConfigRef config);
|
||||
void setDirty(bool isDirty);
|
||||
|
Reference in New Issue
Block a user