Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
TheArcaneBrony committed May 31, 2024
1 parent 808f94b commit 65d6fa9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 10 deletions.
4 changes: 1 addition & 3 deletions ArcaneLibs/Attributes/TableHideAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System.Reflection;

namespace ArcaneLibs.Attributes;

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property, AllowMultiple = false)]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)]
public class TableHideAttribute : Attribute;
5 changes: 2 additions & 3 deletions ArcaneLibs/Collections/ObservableDictionary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ObservableDictionary(ObservableDictionary<TKey, TValue> value) {
}

public event NotifyCollectionChangedEventHandler? CollectionChanged;
public event PropertyChangedEventHandler PropertyChanged;
public event PropertyChangedEventHandler? PropertyChanged;

public int Count => _dictionary.Count;
public bool IsReadOnly => false;
Expand All @@ -42,8 +42,7 @@ public void Add(TKey key, TValue value) {
}

public bool Remove(TKey key) {
if (!_dictionary.ContainsKey(key)) return false;
var value = _dictionary[key];
if (!_dictionary.TryGetValue(key, out var value)) return false;
var result = _dictionary.Remove(key);
if (result) {
CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new KeyValuePair<TKey, TValue>(key, value)));
Expand Down
4 changes: 2 additions & 2 deletions ArcaneLibs/Extensions/Streams/StreamExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public static IEnumerable<byte> ReadTerminatedField(this Stream stream, byte ter
$"Text prefix {stream.Peek(asciiPrefix.Length).AsHexString()} ({stream.Peek(asciiPrefix.Length).AsString()}) does not match expected value of {asciiPrefix.AsBytes().AsHexString()} ({asciiPrefix})!");
else stream.Skip(asciiPrefix.Length);

var read = 0;
// var read = 0;
while (stream.Peek() != terminator) {
// if (_debug)
// Console.WriteLine(
Expand All @@ -137,7 +137,7 @@ public static IEnumerable<byte> ReadTerminatedField(this Stream stream, byte ter
yield break;
}

read++;
// read++;
yield return (byte)stream.ReadByte();
}

Expand Down
2 changes: 0 additions & 2 deletions ArcaneLibs/Util.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO.Compression;
using System.Net;

namespace ArcaneLibs;

Expand Down

0 comments on commit 65d6fa9

Please sign in to comment.