diff options
| author | 2019-10-05 08:17:32 -0400 | |
|---|---|---|
| committer | 2019-10-05 09:14:23 -0400 | |
| commit | 8eb1398f8d90fb2813f438b9fffac716b6ec51d2 (patch) | |
| tree | 39a270023b64af2dce85e3d4a13484c95243b2b3 /src/video_core/shader/expr.h | |
| parent | video_core/ast: Supply const accessors for data where applicable (diff) | |
| download | yuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.tar.gz yuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.tar.xz yuzu-8eb1398f8d90fb2813f438b9fffac716b6ec51d2.zip | |
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>; | |||
| 28 | 28 | ||
| 29 | class ExprAnd final { | 29 | class ExprAnd final { |
| 30 | public: | 30 | public: |
| 31 | explicit ExprAnd(Expr a, Expr b) : operand1{a}, operand2{b} {} | 31 | explicit ExprAnd(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {} |
| 32 | 32 | ||
| 33 | bool operator==(const ExprAnd& b) const; | 33 | bool operator==(const ExprAnd& b) const; |
| 34 | 34 | ||
| @@ -38,7 +38,7 @@ public: | |||
| 38 | 38 | ||
| 39 | class ExprOr final { | 39 | class ExprOr final { |
| 40 | public: | 40 | public: |
| 41 | explicit ExprOr(Expr a, Expr b) : operand1{a}, operand2{b} {} | 41 | explicit ExprOr(Expr a, Expr b) : operand1{std::move(a)}, operand2{std::move(b)} {} |
| 42 | 42 | ||
| 43 | bool operator==(const ExprOr& b) const; | 43 | bool operator==(const ExprOr& b) const; |
| 44 | 44 | ||
| @@ -48,7 +48,7 @@ public: | |||
| 48 | 48 | ||
| 49 | class ExprNot final { | 49 | class ExprNot final { |
| 50 | public: | 50 | public: |
| 51 | explicit ExprNot(Expr a) : operand1{a} {} | 51 | explicit ExprNot(Expr a) : operand1{std::move(a)} {} |
| 52 | 52 | ||
| 53 | bool operator==(const ExprNot& b) const; | 53 | bool operator==(const ExprNot& b) const; |
| 54 | 54 | ||
| @@ -105,9 +105,9 @@ Expr MakeExpr(Args&&... args) { | |||
| 105 | return std::make_shared<ExprData>(T(std::forward<Args>(args)...)); | 105 | return std::make_shared<ExprData>(T(std::forward<Args>(args)...)); |
| 106 | } | 106 | } |
| 107 | 107 | ||
| 108 | bool ExprAreEqual(Expr first, Expr second); | 108 | bool ExprAreEqual(const Expr& first, const Expr& second); |
| 109 | 109 | ||
| 110 | bool ExprAreOpposite(Expr first, Expr second); | 110 | bool ExprAreOpposite(const Expr& first, const Expr& second); |
| 111 | 111 | ||
| 112 | Expr MakeExprNot(Expr first); | 112 | Expr MakeExprNot(Expr first); |
| 113 | 113 | ||
| @@ -115,6 +115,6 @@ Expr MakeExprAnd(Expr first, Expr second); | |||
| 115 | 115 | ||
| 116 | Expr MakeExprOr(Expr first, Expr second); | 116 | Expr MakeExprOr(Expr first, Expr second); |
| 117 | 117 | ||
| 118 | bool ExprIsTrue(Expr first); | 118 | bool ExprIsTrue(const Expr& first); |
| 119 | 119 | ||
| 120 | } // namespace VideoCommon::Shader | 120 | } // namespace VideoCommon::Shader |