| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent db95ed0 commit 4405fc8
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,22 +166,19 @@ class SnapshotSerializerDeserializer { | |||
| 166 | 166 | V(std::string) | |
| 167 | 167 | ||
| 168 | 168 | #define V(TypeName) \ | |
| 169 | - if (std::is_same_v<T, TypeName>) { \ | ||
| 169 | + if constexpr (std::is_same_v<T, TypeName>) { \ | ||
| 170 | 170 | return #TypeName; \ | |
| 171 | - } | ||
| 171 | + } else // NOLINT(readability/braces) | ||
| 172 | 172 | TYPE_LIST(V) | |
| 173 | 173 | #undef V | |
| 174 | 174 | ||
| 175 | - std::string name; | ||
| 176 | - if (std::is_arithmetic_v<T>) { | ||
| 177 | - if (!std::is_signed_v<T>) { | ||
| 178 | - name += "u"; | ||
| 179 | - } | ||
| 180 | - name += std::is_integral_v<T> ? "int" : "float"; | ||
| 181 | - name += std::to_string(sizeof(T) * 8); | ||
| 182 | - name += "_t"; | ||
| 175 | + if constexpr (std::is_arithmetic_v<T>) { | ||
| 176 | + return (std::is_unsigned_v<T> ? "uint" | ||
| 177 | + : std::is_integral_v<T> ? "int" | ||
| 178 | + : "float") + | ||
| 179 | + std::to_string(sizeof(T) * 8) + "_t"; | ||
| 183 | 180 | } | |
| 184 | - return name; | ||
| 181 | + return ""; | ||
| 185 | 182 | } | |
| 186 | 183 | ||
| 187 | 184 | bool is_debug = false; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments