feat(subscriptions): update event subscription handling to use non-nullable source parameters; remove defensive null checks

This commit is contained in:
Miha Kralj
2025-12-26 13:34:21 -08:00
parent 47488985e1
commit 618837dc27
12 changed files with 14 additions and 24 deletions
+3 -12
View File
@@ -33,19 +33,10 @@ public sealed class Blma : AbstractBase, IDisposable
_weightSum = CalculateWeights(period, _weights);
}
public Blma(object source, int period) : this(period)
public Blma(ITValuePublisher source, int period) : this(period)
{
ArgumentNullException.ThrowIfNull(source);
if (source is ITValuePublisher pub)
{
_publisher = pub;
_publisher.Pub += Handle;
}
else
{
throw new ArgumentException("Source must implement ITValuePublisher", nameof(source));
}
_publisher = source;
source.Pub += Handle;
}
public void Dispose()