| 190 | |
| 191 | template <typename ThriftType> |
| 192 | inline static ApiTypeEnum Load(const ThriftType* in) { |
| 193 | const auto raw_value = LoadRaw(in); |
| 194 | if constexpr (std::is_unsigned_v<ApiTypeRawEnum>) { |
| 195 | if (ARROW_PREDICT_FALSE(raw_value >= |
| 196 | static_cast<ApiTypeRawEnum>(ApiType::UNDEFINED))) { |
| 197 | return ApiType::UNDEFINED; |
| 198 | } |
| 199 | } else { |
| 200 | if (ARROW_PREDICT_FALSE(raw_value >= |
| 201 | static_cast<ApiTypeRawEnum>(ApiType::UNDEFINED) || |
| 202 | raw_value < 0)) { |
| 203 | return ApiType::UNDEFINED; |
| 204 | } |
| 205 | } |
| 206 | return FromThriftUnsafe(static_cast<ThriftType>(raw_value)); |
| 207 | } |
| 208 | }; |
| 209 | |
| 210 | } // namespace internal |
nothing calls this directly
no test coverage detected