Return std::make_shared

This commit is contained in:
sabrina-shanman 2018-09-25 12:21:00 -07:00
parent 6e83e96d1c
commit 55ab0a394b
3 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ void LaserPointer::editRenderStatePath(const std::string& state, const QVariant&
PickResultPointer LaserPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
auto rayPickResult = std::dynamic_pointer_cast<RayPickResult>(pickResult);
if (!rayPickResult) {
std::make_shared<RayPickResult>();
return std::make_shared<RayPickResult>();
}
return std::make_shared<RayPickResult>(*rayPickResult.get());
}

View file

@ -33,7 +33,7 @@ ParabolaPointer::ParabolaPointer(const QVariant& rayProps, const RenderStateMap&
PickResultPointer ParabolaPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
auto parabolaPickResult = std::dynamic_pointer_cast<ParabolaPickResult>(pickResult);
if (!parabolaPickResult) {
std::make_shared<ParabolaPickResult>();
return std::make_shared<ParabolaPickResult>();
}
return std::make_shared<ParabolaPickResult>(*parabolaPickResult.get());
}

View file

@ -150,7 +150,7 @@ bool StylusPointer::shouldTrigger(const PickResultPointer& pickResult) {
PickResultPointer StylusPointer::getPickResultCopy(const PickResultPointer& pickResult) const {
auto stylusPickResult = std::dynamic_pointer_cast<StylusPickResult>(pickResult);
if (!stylusPickResult) {
std::make_shared<StylusPickResult>();
return std::make_shared<StylusPickResult>();
}
return std::make_shared<StylusPickResult>(*stylusPickResult.get());
}