private static TypeInfo FindLZ4Level()

in src/DotPulsar/Internal/Compression/Lz4Compression.cs [79:95]


    private static TypeInfo FindLZ4Level(IEnumerable<TypeInfo> types)
    {
        const string fullName = "K4os.Compression.LZ4.LZ4Level";

        foreach (var type in types)
        {
            if (type.FullName is null || !type.FullName.Equals(fullName))
                continue;

            if (type.IsPublic && type.IsEnum && Enum.GetUnderlyingType(type) == typeof(int))
                return type;

            break;
        }

        throw new Exception($"{fullName} as a public enum with an int backing was not found");
    }