Made the acccessors method to return const references
Summary: Made the acccessors method to return const references Reviewed By: emilsjolander Differential Revision: D7321801 fbshipit-source-id: 9fc4da724bc2f58a0d95824ca3c0b5bf1690bccf
This commit is contained in:
committed by
Facebook Github Bot
parent
cb6e76973d
commit
08743a42e2
@@ -14,7 +14,7 @@ YGFloatOptional::YGFloatOptional(const float& value)
|
||||
: value_(value), isUndefined_(false) {}
|
||||
YGFloatOptional::YGFloatOptional() : value_(0), isUndefined_(true) {}
|
||||
|
||||
float YGFloatOptional::getValue() const {
|
||||
const float& YGFloatOptional::getValue() const {
|
||||
if (isUndefined_) {
|
||||
// Abort, accessing a value of an undefined float optional
|
||||
std::cerr << "Tried to get value of an undefined YGFloatOptional\n";
|
||||
@@ -28,7 +28,7 @@ void YGFloatOptional::setValue(const float& val) {
|
||||
isUndefined_ = false;
|
||||
}
|
||||
|
||||
bool YGFloatOptional::isUndefined() const {
|
||||
const bool& YGFloatOptional::isUndefined() const {
|
||||
return isUndefined_;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user