diff --git a/example/simple.d b/example/simple.d index 032ae92..86aa445 100644 --- a/example/simple.d +++ b/example/simple.d @@ -14,7 +14,9 @@ void main() { auto packer = packer(appender!(ubyte[])()); - packer.packArray(null, true, "Hi!", -1, [1, 2]); + int[] emptyArray; + int[int] emptyMap; + packer.packArray(null, true, "Hi!", -1, [1, 2], emptyArray, emptyMap); auto unpacker = StreamingUnpacker(packer.stream.data); diff --git a/src/msgpack.d b/src/msgpack.d index 71cbfc3..8870dc2 100644 --- a/src/msgpack.d +++ b/src/msgpack.d @@ -698,9 +698,6 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St } } - if (array.empty) - return packNil(); - // Raw bytes static if (isByte!(U) || isSomeChar!(U)) { ubyte[] raw = cast(ubyte[])array; @@ -720,9 +717,6 @@ struct PackerImpl(Stream) if (isOutputRange!(Stream, ubyte) && isOutputRange!(St /// ditto ref PackerImpl pack(T)(in T array) if (isAssociativeArray!T) { - if (array is null) - return packNil(); - beginMap(array.length); foreach (key, value; array) { pack(key);