Skip to content

Commit

Permalink
chore: update to latest language features
Browse files Browse the repository at this point in the history
  • Loading branch information
coder2000 committed Jul 1, 2024
1 parent 2b1f78c commit f9b5967
Showing 1 changed file with 7 additions and 14 deletions.
21 changes: 7 additions & 14 deletions src/Ubiety.Stringprep.Core/CompositeMappingTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,20 @@ namespace Ubiety.Stringprep.Core
/// <summary>
/// Composite mapping table.
/// </summary>
internal class CompositeMappingTable : MappingTable
/// <remarks>
/// Initializes a new instance of the <see cref="CompositeMappingTable" /> class.
/// </remarks>
/// <param name="mappingTables">Mapping tables.</param>
internal class CompositeMappingTable(ICollection<IMappingTable> mappingTables) : MappingTable
{
private readonly ICollection<IMappingTable> _mappingTables;

/// <summary>
/// Initializes a new instance of the <see cref="CompositeMappingTable" /> class.
/// </summary>
/// <param name="mappingTables">Mapping tables.</param>
public CompositeMappingTable(ICollection<IMappingTable> mappingTables)
{
_mappingTables = mappingTables;
}

/// <summary>
/// Does the value have a replacement.
/// </summary>
/// <param name="value">Value to find replacement for.</param>
/// <returns>A value indicating whether there is a replacement or not.</returns>
public override bool HasReplacement(int value)
{
return _mappingTables.Any(table => table.HasReplacement(value));
return mappingTables.Any(table => table.HasReplacement(value));
}

/// <summary>
Expand All @@ -62,7 +55,7 @@ public override bool HasReplacement(int value)
/// <returns>Replacement for the value.</returns>
public override int[] GetReplacement(int value)
{
return _mappingTables.FirstOrDefault(table => table.HasReplacement(value))?.GetReplacement(value);
return mappingTables.FirstOrDefault(table => table.HasReplacement(value))?.GetReplacement(value);
}
}
}

0 comments on commit f9b5967

Please sign in to comment.