Skip to content

Commit 5db05cd

Browse files
committed
Namespace fix. Added LinksConstantsExtensions.
1 parent 0b0dde6 commit 5db05cd

File tree

5 files changed

+19
-4
lines changed

5 files changed

+19
-4
lines changed

ILinks.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Collections.Generic;
3-
using Platform.Data.Constants;
43

54
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
65

ILinksExtensions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.Collections.Generic;
33
using System.Runtime.CompilerServices;
44
using Platform.Setters;
5-
using Platform.Data.Constants;
65
using Platform.Data.Exceptions;
76

87
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

ISynchronizedLinks.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Platform.Threading.Synchronization;
2-
using Platform.Data.Constants;
32

43
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
54

LinksConstants.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
66

7-
namespace Platform.Data.Constants
7+
namespace Platform.Data
88
{
99
public class LinksConstants<TAddress>
1010
{

LinksConstantsExtensions.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
2+
3+
using System.Runtime.CompilerServices;
4+
5+
namespace Platform.Data
6+
{
7+
public static class LinksConstantsExtensions
8+
{
9+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
10+
public static bool IsReference<TAddress>(this LinksConstants<TAddress> linksConstants, TAddress address) => linksConstants.IsInnerReference(address) || linksConstants.IsExternalReference(address);
11+
12+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
13+
public static bool IsInnerReference<TAddress>(this LinksConstants<TAddress> linksConstants, TAddress address) => linksConstants.PossibleInnerReferencesRange.ContainsValue(address);
14+
15+
[MethodImpl(MethodImplOptions.AggressiveInlining)]
16+
public static bool IsExternalReference<TAddress>(this LinksConstants<TAddress> linksConstants, TAddress address) => linksConstants.PossibleExternalReferencesRange?.ContainsValue(address) ?? false;
17+
}
18+
}

0 commit comments

Comments
 (0)