[#30] Client: Add object model for Rules, fix for comments
All checks were successful
DCO / DCO (pull_request) Successful in 25s
lint-build / dotnet8.0 (pull_request) Successful in 51s

Signed-off-by: Pavel Gross <p.gross@yadro.com>
This commit is contained in:
Pavel Gross 2025-02-12 16:18:34 +03:00
parent cdad8ad3a8
commit 13da97520d

View file

@ -88,17 +88,26 @@ internal static class RuleSerializer
return Int64Size(len) + len;
}
private static int ActionsSize(Actions? action)
private static int ActionsSize(Actions action)
{
return BoolSize // Inverted
+ (action != null ? SliceSize(action.Names, StringSize) : 0);
if (action is null)
{
throw new ArgumentNullException(nameof(action));
}
return BoolSize // Inverted
+ SliceSize(action.Names, StringSize);
}
private static int ResourcesSize(Resource? resource)
private static int ResourcesSize(Resource resource)
{
if (resource is null)
{
throw new ArgumentNullException(nameof(resource));
}
return BoolSize // Inverted
+ (resource != null ? SliceSize(resource.Names, StringSize) : 0);
+ SliceSize(resource.Names, StringSize);
}
private static int ConditionSize(Condition condition)