summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-07-18 10:02:46 -0700
committerGravatar GitHub2018-07-18 10:02:46 -0700
commite3da9fc3677087a267f489ea69bcdd312dd876fe (patch)
tree493c602ae5222c2afb55af6627a2e4d6b8608048 /src
parentMerge pull request #679 from lioncash/ctor (diff)
parenttelemetry: Remove unnecessary Field constructor (diff)
downloadyuzu-e3da9fc3677087a267f489ea69bcdd312dd876fe.tar.gz
yuzu-e3da9fc3677087a267f489ea69bcdd312dd876fe.tar.xz
yuzu-e3da9fc3677087a267f489ea69bcdd312dd876fe.zip
Merge pull request #682 from lioncash/telemetry
Telemetry: Minor changes
Diffstat (limited to 'src')
-rw-r--r--src/common/telemetry.h27
1 files changed, 7 insertions, 20 deletions
diff --git a/src/common/telemetry.h b/src/common/telemetry.h
index 7a09df0a7..3bab75b59 100644
--- a/src/common/telemetry.h
+++ b/src/common/telemetry.h
@@ -52,27 +52,14 @@ public:
52template <typename T> 52template <typename T>
53class Field : public FieldInterface { 53class Field : public FieldInterface {
54public: 54public:
55 Field(FieldType type, std::string name, const T& value) 55 Field(FieldType type, std::string name, T value)
56 : name(std::move(name)), type(type), value(value) {}
57
58 Field(FieldType type, std::string name, T&& value)
59 : name(std::move(name)), type(type), value(std::move(value)) {} 56 : name(std::move(name)), type(type), value(std::move(value)) {}
60 57
61 Field(const Field& other) : Field(other.type, other.name, other.value) {} 58 Field(const Field&) = default;
62 59 Field& operator=(const Field&) = default;
63 Field& operator=(const Field& other) {
64 type = other.type;
65 name = other.name;
66 value = other.value;
67 return *this;
68 }
69 60
70 Field& operator=(Field&& other) { 61 Field(Field&&) = default;
71 type = other.type; 62 Field& operator=(Field&& other) = default;
72 name = std::move(other.name);
73 value = std::move(other.value);
74 return *this;
75 }
76 63
77 void Accept(VisitorInterface& visitor) const override; 64 void Accept(VisitorInterface& visitor) const override;
78 65
@@ -94,11 +81,11 @@ public:
94 return value; 81 return value;
95 } 82 }
96 83
97 inline bool operator==(const Field<T>& other) { 84 bool operator==(const Field& other) const {
98 return (type == other.type) && (name == other.name) && (value == other.value); 85 return (type == other.type) && (name == other.name) && (value == other.value);
99 } 86 }
100 87
101 inline bool operator!=(const Field<T>& other) { 88 bool operator!=(const Field& other) const {
102 return !(*this == other); 89 return !(*this == other);
103 } 90 }
104 91