using AsmResolver.PE.Debug.CodeView;

namespace AsmResolver.PE.Debug
{
    /// <summary>
    /// Provides a default implementation of the <see cref="IDebugDataReader"/> interface.
    /// </summary>
    public class DefaultDebugDataReader : IDebugDataReader
    {
        /// <inheritdoc />
        public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type,
            IBinaryStreamReader reader)
        {
            if (type == DebugDataType.CodeView)
                return CodeViewDataSegment.FromReader(reader);

            return new CustomDebugDataSegment(type, DataSegment.FromReader(reader));
        }
    }
}

using AsmResolver.PE.Debug.CodeView;

namespace AsmResolver.PE.Debug
{
    /// <summary>
    /// Provides a default implementation of the <see cref="IDebugDataReader"/> interface.
    /// </summary>
    public class DefaultDebugDataReader : IDebugDataReader
    {
        /// <inheritdoc />
        public IDebugDataSegment ReadDebugData(PEReaderContext context, DebugDataType type,
            IBinaryStreamReader reader)
        {
            return type switch
            {
                DebugDataType.CodeView => CodeViewDataSegment.FromReader(reader, context),
                _ => new CustomDebugDataSegment(type, DataSegment.FromReader(reader))
            };
        }
    }
}

Change if to switch expression
Change if to switch expression
