diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-10-05 08:17:32 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-10-05 09:14:23 -0400 |
| commit | 8eb1398f8d90fb2813f438b9fffac716b6ec51d2 (patch) | |
| tree | 39a270023b64af2dce85e3d4a13484c95243b2b3 /src/video_core/shader/expr.h | |
| parent | 8e0c80f26914552e11144bd92dae726b66c3739d (diff) | |
video_core/{ast, expr}: Use std::move where applicable
Avoids unnecessary atomic reference count increments and decrements.
Diffstat (limited to 'src/video_core/shader/expr.h')
| -rw-r--r-- | src/video_core/shader/expr.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/video_core/shader/expr.h b/src/video_core/shader/expr.h index 4c399cef9..1f1638520 100644 --- a/src/video_core/shader/expr.h +++ b/src/video_core/shader/expr.h @@ -28,7 +28,7 @@ using Expr = std::shared_ptr<ExprData>; class ExprAnd final { public: - explicit ExprAnd(Expr a, Expr b) : operand1{a}, operand2{b} {} + explicit ExprAnd(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {} bool operator==(const ExprAnd& b) const; @@ -38,7 +38,7 @@ public: class ExprOr final { public: - explicit ExprOr(Expr a, Expr b) : operand1{a}, operand2{b} {} + explicit ExprOr(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {} bool operator==(const ExprOr& b) const; @@ -48,7 +48,7 @@ public: class ExprNot final { public: - explicit ExprNot(Expr a) : operand1{a} {} + explicit ExprNot(Expr a) : operand1{std::move(a)} {} bool operator==(const ExprNot& b) const; @@ -105,9 +105,9 @@ Expr MakeExpr(Args&&... args) { return std::make_shared<ExprData>(T(std::forward<Args>(args)...)); } -bool ExprAreEqual(Expr first, Expr second); +bool ExprAreEqual(const Expr& first, const Expr& second); -bool ExprAreOpposite(Expr first, Expr second); +bool ExprAreOpposite(const Expr& first, const Expr& second); Expr MakeExprNot(Expr first); @@ -115,6 +115,6 @@ Expr MakeExprAnd(Expr first, Expr second); Expr MakeExprOr(Expr first, Expr second); -bool ExprIsTrue(Expr first); +bool ExprIsTrue(const Expr& first); } // namespace VideoCommon::Shader |
