Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if !NETCOREAPP
#if NET

#pragma warning disable RS0016 // Add public types and members to the declared API (this is a supporting forwarder for an internal polyfill API)
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Index))]
#pragma warning restore RS0016 // Add public types and members to the declared API

#else

using System.Runtime.CompilerServices;

namespace System
{
/// <summary>Represent a type can be used to index a collection either from the start or the end.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<Compile Include="$(MSBuildThisFileDirectory)RequiredMemberAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SetsRequiredMembersAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ExceptionUtilities.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Index.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Range.cs" />
</ItemGroup>
<ItemGroup Condition="'$(DefaultLanguageSourceExtension)' != '' AND '$(BuildingInsideVisualStudio)' != 'true'">
<ExpectedCompile Include="$(MSBuildThisFileDirectory)**\*$(DefaultLanguageSourceExtension)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

#if !NETCOREAPP
#if NET

#pragma warning disable RS0016 // Add public types and members to the declared API (this is a supporting forwarder for an internal polyfill API)
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Range))]
#pragma warning restore RS0016 // Add public types and members to the declared API

#else
using System.Runtime.CompilerServices;
using Roslyn.Utilities;

namespace System
{
/// <summary>Represent a range has start and end indexes.</summary>
Expand Down Expand Up @@ -46,9 +52,7 @@ value is Range r &&

/// <summary>Returns the hash code for this instance.</summary>
public override int GetHashCode()
{
return Hash.Combine(Start.GetHashCode(), End.GetHashCode());
}
=> unchecked(Start.GetHashCode() * (int)0xA5555529 + End.GetHashCode());

/// <summary>Converts the value of the current Range object to its equivalent string representation.</summary>
public override string ToString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,5 @@
<ItemGroup>
<InternalsVisibleTo Include="SemanticSearch.BuildTask.UnitTests" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Range.cs" Link="Utilities\Range.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Index.cs" Link="Utilities\Index.cs" />
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Hash.cs" Link="Utilities\Hash.cs" />
</ItemGroup>
<Import Project="..\..\..\Dependencies\Contracts\Microsoft.CodeAnalysis.Contracts.projitems" Label="Shared" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\ImmutableListExtensions.cs">
<Link>InternalUtilities\ImmutableListExtensions.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\Index.cs">
<Link>InternalUtilities\Index.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\ISetExtensions.cs">
<Link>InternalUtilities\ISetExtensions.cs</Link>
</Compile>
Expand All @@ -140,9 +137,6 @@
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs">
<Link>InternalUtilities\PlatformInformation.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\Range.cs">
<Link>InternalUtilities\Range.cs</Link>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)..\..\..\..\Compilers\Core\Portable\InternalUtilities\ReaderWriterLockSlimExtensions.cs">
<Link>InternalUtilities\ReaderWriterLockSlimExtensions.cs</Link>
</Compile>
Expand Down