[#13] Client: Use code analyzers

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2024-09-23 18:53:21 +03:00
parent d7dbbf8da8
commit d1271df207
102 changed files with 2168 additions and 733 deletions

View file

@ -17,19 +17,23 @@ public static class ContainerIdMapper
public static ContainerID ToMessage(this FrostFsContainerId model)
{
if (model.Value == null)
if (model is null)
{
throw new ArgumentNullException(nameof(model));
if (!Cache.Containers.TryGetValue(model.Value, out ContainerID? message))
}
var containerId = model.GetValue() ?? throw new ArgumentNullException(nameof(model));
if (!Cache.Containers.TryGetValue(containerId, out ContainerID? message))
{
message = new ContainerID
{
Value = ByteString.CopyFrom(Base58.Decode(model.Value))
Value = ByteString.CopyFrom(Base58.Decode(containerId))
};
Cache.Containers.Set(model.Value, message, _oneHourExpiration);
Cache.Containers.Set(containerId, message, _oneHourExpiration);
}
return message!;
return message!;
}
}