 
 extension Array where Element == Document {
     init(buffer: inout ByteBuffer, count: Int) throws {
-        var array = [Document]()
-        array.reserveCapacity(count)
+        self = []
+        reserveCapacity(count)
         
         for _ in 0..<count {
             let documentSize = try buffer.getInteger(

                throw MongoKittenError(.protocolParsingError, reason: nil)
            }
            
            array.append(Document(bytes: bytes))
        }
        
        self = array
    }
}


            switch kind {
            case 0: // body
                documents += try [Document](buffer: &buffer, count: 1)
            case 1: // document sequence
                let size = try buffer.assertLittleEndian() as Int32
                let documentSequenceIdentifier = try buffer.readCString() // Document sequence identifier
                // TODO: Handle document sequence identifier correctly
                
                let bsonObjectsSectionSize = Int(size) - 4 - documentSequenceIdentifier.utf8.count - 1
                guard bsonObjectsSectionSize > 0 else {
                    throw MongoKittenError(.protocolParsingError, reason: .unexpectedValue)
                }
                
                documents += try [Document](buffer: &buffer, consumeBytes: bsonObjectsSectionSize)
            default:
                throw MongoKittenError(.protocolParsingError, reason: .unexpectedValue)
            }
        }
        
        if flags.contains(.checksumPresent) {
            // Checksum validation is unimplemented
            // MongoDB 3.6 does not support validating the message checksum, but will correctly skip it if present.
            buffer.moveReaderIndex(forwardBy: 4)
        }
        
        return ServerReply(responseTo: responseTo, cursorId: 0, documents: documents)
