From e5836c4283718f1de007e9eb04accc60521af240 Mon Sep 17 00:00:00 2001 From: Federico Barresi Date: Wed, 18 May 2022 14:35:26 +0200 Subject: [PATCH] Removed obsolete function SetBitAt - fix #27 --- CHANGELOG.md | 6 ++++++ Sharp7.Tests/TestUtilities.cs | 2 +- Sharp7/S7.cs | 6 ------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d3924f5..520d0c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # Change Log All notable changed to this project will be documented in this file. +## [1.1.81] - 18.05.2022 +### Added +### Changed +### Fixed +- Removed obsolete SetBitAt [#27](https://github.com/fbarresi/Sharp7/issues/27) + ## [1.1.80] - 18.05.2022 ### Added ### Changed diff --git a/Sharp7.Tests/TestUtilities.cs b/Sharp7.Tests/TestUtilities.cs index 8f95fab..4d4b1a6 100644 --- a/Sharp7.Tests/TestUtilities.cs +++ b/Sharp7.Tests/TestUtilities.cs @@ -25,7 +25,7 @@ namespace Sharp7.Tests [Fact] public void TestGetBitAt() { S7.GetBitAt(new byte[] {1,2,3,4}, 0, 0).ShouldBe(true); } [Fact] public void TestSetBitAt() { var buffer = new byte[] {1,2,3,4}; - S7.SetBitAt(ref buffer, 0, 1, true); + S7.SetBitAt(buffer, 0, 1, true); buffer.ShouldBe(new byte[] {3, 2, 3, 4}); } [Fact] public void TestSetBitAtAsExtensionMethod() { diff --git a/Sharp7/S7.cs b/Sharp7/S7.cs index ee24c7a..5a8a579 100644 --- a/Sharp7/S7.cs +++ b/Sharp7/S7.cs @@ -49,12 +49,6 @@ namespace Sharp7 return (buffer[pos] & Mask[bit]) != 0; } - [Obsolete("Use SetBitAt as extension method")] - public static void SetBitAt(ref byte[] buffer, int pos, int bit, bool value) - { - buffer.SetBitAt(pos, bit, value); - } - public static void SetBitAt(this byte[] buffer, int pos, int bit, bool value) { byte[] Mask = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80};