Changed all == null to is null and all !(* == null) to * is not null

This commit is contained in:
Kwoth
2021-06-19 08:24:09 +02:00
parent 81406cb46a
commit d8c7cdc7f4
125 changed files with 367 additions and 366 deletions

View File

@@ -35,7 +35,7 @@ namespace NadekoBot.Core.Services.Impl
CultureInfo cultureInfo = null;
try
{
if (x.Value == null)
if (x.Value is null)
return null;
cultureInfo = new CultureInfo(x.Value);
}
@@ -108,7 +108,7 @@ namespace NadekoBot.Core.Services.Impl
{
_commandData.TryGetValue(key, out var toReturn);
if (toReturn == null)
if (toReturn is null)
return new CommandData
{
Cmd = key,

View File

@@ -81,7 +81,7 @@ namespace NadekoBot.Core.Services.Impl
{
var time = TimeSpan.FromHours(period);
var _db = Redis.GetDatabase();
if ((bool?)_db.StringGet($"{_redisKey}_timelyclaim_{id}") == null)
if ((bool?)_db.StringGet($"{_redisKey}_timelyclaim_{id}") is null)
{
_db.StringSet($"{_redisKey}_timelyclaim_{id}", true, time);
return null;
@@ -104,7 +104,7 @@ namespace NadekoBot.Core.Services.Impl
{
var _db = Redis.GetDatabase();
time = _db.KeyTimeToLive($"{_redisKey}_affinity_{userId}");
if (time == null)
if (time is null)
{
time = TimeSpan.FromMinutes(30);
_db.StringSet($"{_redisKey}_affinity_{userId}", true, time);
@@ -117,7 +117,7 @@ namespace NadekoBot.Core.Services.Impl
{
var _db = Redis.GetDatabase();
time = _db.KeyTimeToLive($"{_redisKey}_divorce_{userId}");
if (time == null)
if (time is null)
{
time = TimeSpan.FromHours(6);
_db.StringSet($"{_redisKey}_divorce_{userId}", true, time);
@@ -182,7 +182,7 @@ namespace NadekoBot.Core.Services.Impl
{
var obj = await factory(param).ConfigureAwait(false);
if (obj == null)
if (obj is null)
return default(TOut);
await _db.StringSetAsync(key, JsonConvert.SerializeObject(obj),