From 76992ca366bda4d6da43054b9e4f6e288a565246 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82=D0=B8?= =?UTF-8?q?=D0=BD=20=D0=94=D1=8C=D1=8F=D1=87=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Tue, 30 Jul 2019 10:36:28 +0300 Subject: [PATCH] Codacy issues fix. --- Link.cs | 2 +- Net.cs | 2 +- NumberHelpers.cs | 3 ++- Sequences/SequenceHelpers.cs | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Link.cs b/Link.cs index 3808423..9395ef0 100644 --- a/Link.cs +++ b/Link.cs @@ -301,7 +301,7 @@ public static Link Create(Link source, Link linker, Link target) Link link = CreateLink(source, linker, target); if (link == null) { - throw new OutOfMemoryException(); + throw new InvalidOperationException("Невозможно создать связь."); } CreatedEvent.Invoke(new LinkDefinition(link)); return link; diff --git a/Net.cs b/Net.cs index 28a3e4e..9130d13 100644 --- a/Net.cs +++ b/Net.cs @@ -50,7 +50,7 @@ public enum NetMapping : long Code } - public class Net + public static class Net { public static Link Link { get; private set; } public static Link Thing { get; private set; } diff --git a/NumberHelpers.cs b/NumberHelpers.cs index b8f38a7..6c1623d 100644 --- a/NumberHelpers.cs +++ b/NumberHelpers.cs @@ -70,7 +70,8 @@ public static Link FromNumber(long number) { if ((number & key) == key) { - links[i++] = FromPowerOf2(powerOf2); + links[i] = FromPowerOf2(powerOf2); + i++; } } } diff --git a/Sequences/SequenceHelpers.cs b/Sequences/SequenceHelpers.cs index 074f832..315cc05 100644 --- a/Sequences/SequenceHelpers.cs +++ b/Sequences/SequenceHelpers.cs @@ -9,7 +9,7 @@ namespace Platform.Data.Triplets.Sequences /// TODO: Check that CollectMatchingSequences algorithm is working, if not throw it away. /// TODO: Think of the abstraction on Sequences that can be equally usefull for triple links, doublet links and so on. /// - public class SequenceHelpers + public static class SequenceHelpers { public static readonly int MaxSequenceFormatSize = 20;