Skip to content

Commit

Permalink
Remove redundant owner call
Browse files Browse the repository at this point in the history
  • Loading branch information
muit committed Oct 18, 2023
1 parent e22ba35 commit e3ebf5a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Source/Actions/Private/Action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ UObject* UAction::GetOwner() const

AActor* UAction::GetOwnerActor() const
{
UObject* Owner = GetOwner();
// With this function we can predict the owner is more likely to be an actor so we check it first
if (AActor* Actor = Cast<AActor>(Owner))
{
Expand All @@ -241,7 +240,7 @@ AActor* UAction::GetOwnerActor() const

UActorComponent* UAction::GetOwnerComponent() const
{
return Cast<UActorComponent>(GetOwner());
return Cast<UActorComponent>(Owner);
}

UWorld* UAction::GetWorld() const
Expand Down

0 comments on commit e3ebf5a

Please sign in to comment.