Skip to content

Commit c2cf562

Browse files
committed
also force attributes to be pairs (same semantics as maps)
1 parent 2248628 commit c2cf562

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/StackExchange.Redis/PhysicalConnection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -937,13 +937,13 @@ internal static void WriteMultiBulkHeader(PipeWriter output, long count, ResultT
937937
ResultType.Set => (byte)'~',
938938
_ => (byte)'*',
939939
};
940-
if (type is ResultType.Map & count > 0)
940+
if ((type is ResultType.Map or ResultType.Attribute) & count > 0)
941941
{
942-
if ((count & 1) != 0) Throw(count);
942+
if ((count & 1) != 0) Throw(type, count);
943943
count >>= 1;
944-
static void Throw(long count) => throw new ArgumentOutOfRangeException(
944+
static void Throw(ResultType type, long count) => throw new ArgumentOutOfRangeException(
945945
paramName: nameof(count),
946-
message: $"Map data must be in pairs; got {count}");
946+
message: $"{type} data must be in pairs; got {count}");
947947
}
948948
int offset = WriteRaw(span, count, offset: 1);
949949
output.Advance(offset);

0 commit comments

Comments
 (0)