Skip to content

Commit 52e3041

Browse files
committed
Code cleanup.
1 parent 709c8bf commit 52e3041

File tree

8 files changed

+16
-16
lines changed

8 files changed

+16
-16
lines changed

Algo/Storages/BufferMessageAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ protected override void OnInnerAdapterNewOutMessage(Message message)
568568
}
569569
case MessageTypes.News:
570570
{
571-
if (CanStore<NewsMessage>(default(SecurityId)))
571+
if (CanStore<NewsMessage>(default))
572572
_newsBuffer.Add((NewsMessage)message.Clone());
573573

574574
break;

Algo/Storages/Csv/CsvMarketDataSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public abstract class CsvMarketDataSerializer<TData> : IMarketDataSerializer<TDa
121121
/// </summary>
122122
/// <param name="encoding">Encoding.</param>
123123
protected CsvMarketDataSerializer(Encoding encoding = null)
124-
: this(default(SecurityId), encoding)
124+
: this(default, encoding)
125125
{
126126
}
127127

Algo/Storages/StorageRegistry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ DateTimeOffset IMarketDataStorageInfo<MyTrade>.GetTime(MyTrade data)
414414
private sealed class NewsStorage : ConvertableStorage<NewsMessage, News, VoidType>
415415
{
416416
public NewsStorage(StorageRegistry parent, Security security, SecurityId securityId, IMarketDataSerializer<NewsMessage> serializer, IMarketDataStorageDrive drive)
417-
: base(parent, security, securityId, null, m => m.ServerTime, m => default(SecurityId), m => null, serializer, drive)
417+
: base(parent, security, securityId, null, m => m.ServerTime, m => default, m => null, serializer, drive)
418418
{
419419
}
420420

Algo/Strategies/Strategy.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ private set
786786
case ProcessStates.Stopped:
787787
{
788788
TotalWorkingTime += CurrentTime - StartedTime;
789-
StartedTime = default(DateTimeOffset);
789+
StartedTime = default;
790790
LogProcessState(value);
791791
OnStopped();
792792
break;
@@ -1032,7 +1032,7 @@ public TimeSpan TotalWorkingTime
10321032
{
10331033
var retVal = _totalWorkingTime;
10341034

1035-
if (StartedTime != default(DateTimeOffset) && Connector != null)
1035+
if (StartedTime != default && Connector != null)
10361036
retVal += CurrentTime - StartedTime;
10371037

10381038
return retVal;
@@ -1580,7 +1580,7 @@ private void ProcessOrder(Order order, bool isChanging)
15801580
RaisePositionChanged();
15811581
}
15821582

1583-
if (_firstOrderTime == default(DateTimeOffset))
1583+
if (_firstOrderTime == default)
15841584
_firstOrderTime = order.Time;
15851585

15861586
_lastOrderTime = order.Time;
@@ -1789,7 +1789,7 @@ public virtual void Reset()
17891789
ErrorState = LogLevels.Info;
17901790
ErrorCount = 0;
17911791

1792-
_firstOrderTime = _lastOrderTime = _lastPnlRefreshTime = _prevTradeDate = default(DateTimeOffset);
1792+
_firstOrderTime = _lastOrderTime = _lastPnlRefreshTime = _prevTradeDate = default;
17931793
_idStr = null;
17941794

17951795
_positions.Clear();

Algo/Strategies/StrategyParam.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public class StrategyParam<T> : IStrategyParam
7575
/// <param name="strategy">Strategy.</param>
7676
/// <param name="name">Parameter name.</param>
7777
public StrategyParam(Strategy strategy, string name)
78-
: this(strategy, name, name, default(T))
78+
: this(strategy, name, name, default)
7979
{
8080
}
8181

@@ -86,7 +86,7 @@ public StrategyParam(Strategy strategy, string name)
8686
/// <param name="id">Parameter identifier.</param>
8787
/// <param name="name">Parameter name.</param>
8888
public StrategyParam(Strategy strategy, string id, string name)
89-
: this(strategy, id, name, default(T))
89+
: this(strategy, id, name, default)
9090
{
9191
}
9292

Algo/Strategies/StrategyParamHelper.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public static class StrategyParamHelper
2020
/// <param name="name">Parameter name.</param>
2121
/// <param name="initialValue">The initial value.</param>
2222
/// <returns>The strategy parameter.</returns>
23-
public static StrategyParam<T> Param<T>(this Strategy strategy, string name, T initialValue = default(T))
23+
public static StrategyParam<T> Param<T>(this Strategy strategy, string name, T initialValue = default)
2424
{
2525
return new StrategyParam<T>(strategy, name, initialValue);
2626
}
@@ -34,7 +34,7 @@ public static class StrategyParamHelper
3434
/// <param name="name">Parameter name.</param>
3535
/// <param name="initialValue">The initial value.</param>
3636
/// <returns>The strategy parameter.</returns>
37-
public static StrategyParam<T> Param<T>(this Strategy strategy, string id, string name, T initialValue = default(T))
37+
public static StrategyParam<T> Param<T>(this Strategy strategy, string id, string name, T initialValue = default)
3838
{
3939
return new StrategyParam<T>(strategy, id, name, initialValue);
4040
}
@@ -48,7 +48,7 @@ public static class StrategyParamHelper
4848
/// <param name="optimizeTo">The To value at optimization.</param>
4949
/// <param name="optimizeStep">The Increment value at optimization.</param>
5050
/// <returns>The strategy parameter.</returns>
51-
public static StrategyParam<T> Optimize<T>(this StrategyParam<T> param, T optimizeFrom = default(T), T optimizeTo = default(T), T optimizeStep = default(T))
51+
public static StrategyParam<T> Optimize<T>(this StrategyParam<T> param, T optimizeFrom = default, T optimizeTo = default, T optimizeStep = default)
5252
{
5353
if (param == null)
5454
throw new ArgumentNullException(nameof(param));

Algo/SubscriptionMessageAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private List<Message> ReplicateMessages(Message message)
376376
return null;
377377
}
378378

379-
private SecurityId GetSecurityId(SecurityId securityId) => IsSupportSubscriptionBySecurity ? securityId : default(SecurityId);
379+
private SecurityId GetSecurityId(SecurityId securityId) => IsSupportSubscriptionBySecurity ? securityId : default;
380380

381381
private void ProcessInMarketDataMessage(MarketDataMessage message)
382382
{

Algo/Testing/HistoryMessageAdapter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public override IEnumerable<MarketDataTypes> SupportedMarketDataTypes
208208
{
209209
var drive = DriveInternal;
210210

211-
var dataTypes = drive.GetAvailableDataTypes(default(SecurityId), StorageFormat);
211+
var dataTypes = drive.GetAvailableDataTypes(default, StorageFormat);
212212

213213
_supportedMarketDataTypes = dataTypes
214214
.Select(dt => dt.ToMarketDataType())
@@ -268,7 +268,7 @@ protected override void OnSendInMessage(Message message)
268268
case MessageTypes.Reset:
269269
{
270270
_isSuspended = false;
271-
_currentTime = default(DateTimeOffset);
271+
_currentTime = default;
272272

273273
_generators.Clear();
274274
_historySources.Clear();
@@ -446,7 +446,7 @@ Func<DateTimeOffset, IEnumerable<Message>> GetHistorySource2(SecurityId s)
446446
return _historySources.TryGetValue(Tuple.Create(s, message.DataType, message.Arg));
447447
}
448448

449-
return GetHistorySource2(message.SecurityId) ?? GetHistorySource2(default(SecurityId));
449+
return GetHistorySource2(message.SecurityId) ?? GetHistorySource2(default);
450450
}
451451

452452
Exception error = null;

0 commit comments

Comments
 (0)