Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 18348095 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove MIN and MAX checking for hidl_enum in UserHalHelper native library."

parents 63773a0d b7d50b91
Loading
Loading
Loading
Loading
+0 −5
Original line number Diff line number Diff line
@@ -141,11 +141,6 @@ Result<void> parseUserAssociations(const hidl_vec<int32_t>& int32Values, size_t
template <typename T>
Result<T> verifyAndCast(int32_t value) {
    T castValue = static_cast<T>(value);
    const auto iter = hidl_enum_range<T>();
    if (castValue < *iter.begin() || castValue > *std::prev(iter.end())) {
        return Error() << "Value " << value << " not in range [" << toString(*iter.begin()) << ", "
                       << toString(*std::prev(iter.end())) << "]";
    }
    for (const auto& v : hidl_enum_range<T>()) {
        if (castValue == v) {
            return castValue;