@@ -44,255 +44,232 @@ public Model(ConnectionConfig config, ISession session) : base(config, session)
4444
4545 public override void ConnectionTuneOk ( ushort channelMax , uint frameMax , ushort heartbeat )
4646 {
47- var cmd = new ConnectionTuneOk ( channelMax , frameMax , heartbeat ) ;
48- ModelSend ( ref cmd ) ;
47+ ModelSend ( new ConnectionTuneOk ( channelMax , frameMax , heartbeat ) ) ;
4948 }
5049
5150 public override void _Private_BasicCancel ( string consumerTag , bool nowait )
5251 {
53- var cmd = new BasicCancel ( consumerTag , nowait ) ;
54- ModelSend ( ref cmd ) ;
52+ ModelSend ( new BasicCancel ( consumerTag , nowait ) ) ;
5553 }
5654
5755 public override void _Private_BasicConsume ( string queue , string consumerTag , bool noLocal , bool autoAck , bool exclusive , bool nowait , IDictionary < string , object > arguments )
5856 {
59- var cmd = new BasicConsume ( queue , consumerTag , noLocal , autoAck , exclusive , nowait , arguments ) ;
60- ModelSend ( ref cmd ) ;
57+ ModelSend ( new BasicConsume ( queue , consumerTag , noLocal , autoAck , exclusive , nowait , arguments ) ) ;
6158 }
6259
6360 public override void _Private_BasicGet ( string queue , bool autoAck )
6461 {
65- var cmd = new BasicGet ( queue , autoAck ) ;
66- ModelSend ( ref cmd ) ;
62+ ModelSend ( new BasicGet ( queue , autoAck ) ) ;
6763 }
6864
6965 public override void _Private_BasicRecover ( bool requeue )
7066 {
71- var cmd = new BasicRecover ( requeue ) ;
72- ModelSend ( ref cmd ) ;
67+ ModelSend ( new BasicRecover ( requeue ) ) ;
7368 }
7469
7570 public override void _Private_ChannelClose ( ushort replyCode , string replyText , ushort classId , ushort methodId )
7671 {
77- var cmd = new ChannelClose ( replyCode , replyText , classId , methodId ) ;
78- ModelSend ( ref cmd ) ;
72+ ModelSend ( new ChannelClose ( replyCode , replyText , classId , methodId ) ) ;
7973 }
8074
8175 public override void _Private_ChannelCloseOk ( )
8276 {
83- var cmd = new ChannelCloseOk ( ) ;
84- ModelSend ( ref cmd ) ;
77+ ModelSend ( new ChannelCloseOk ( ) ) ;
8578 }
8679
8780 public override void _Private_ChannelFlowOk ( bool active )
8881 {
89- var cmd = new ChannelFlowOk ( active ) ;
90- ModelSend ( ref cmd ) ;
82+ ModelSend ( new ChannelFlowOk ( active ) ) ;
9183 }
9284
9385 public override void _Private_ChannelOpen ( )
9486 {
95- var cmd = new ChannelOpen ( ) ;
96- ModelRpc ( ref cmd , ProtocolCommandId . ChannelOpenOk ) ;
87+ ModelRpc ( new ChannelOpen ( ) , ProtocolCommandId . ChannelOpenOk ) ;
9788 }
9889
9990 public override void _Private_ConfirmSelect ( bool nowait )
10091 {
10192 var method = new ConfirmSelect ( nowait ) ;
10293 if ( nowait )
10394 {
104- ModelSend ( ref method ) ;
95+ ModelSend ( method ) ;
10596 }
10697 else
10798 {
108- ModelRpc ( ref method , ProtocolCommandId . ConfirmSelectOk ) ;
99+ ModelRpc ( method , ProtocolCommandId . ConfirmSelectOk ) ;
109100 }
110101 }
111102
112103 public override void _Private_ConnectionCloseOk ( )
113104 {
114- var cmd = new ConnectionCloseOk ( ) ;
115- ModelSend ( ref cmd ) ;
105+ ModelSend ( new ConnectionCloseOk ( ) ) ;
116106 }
117107
118108 public override void _Private_ConnectionOpen ( string virtualHost )
119109 {
120- var cmd = new ConnectionOpen ( virtualHost ) ;
121- ModelSend ( ref cmd ) ;
110+ ModelSend ( new ConnectionOpen ( virtualHost ) ) ;
122111 }
123112
124113 public override void _Private_ConnectionSecureOk ( byte [ ] response )
125114 {
126- var cmd = new ConnectionSecureOk ( response ) ;
127- ModelSend ( ref cmd ) ;
115+ ModelSend ( new ConnectionSecureOk ( response ) ) ;
128116 }
129117
130118 public override void _Private_ConnectionStartOk ( IDictionary < string , object > clientProperties , string mechanism , byte [ ] response , string locale )
131119 {
132- var cmd = new ConnectionStartOk ( clientProperties , mechanism , response , locale ) ;
133- ModelSend ( ref cmd ) ;
120+ ModelSend ( new ConnectionStartOk ( clientProperties , mechanism , response , locale ) ) ;
134121 }
135122
136123 public override void _Private_UpdateSecret ( byte [ ] newSecret , string reason )
137124 {
138- var cmd = new ConnectionUpdateSecret ( newSecret , reason ) ;
139- ModelRpc ( ref cmd , ProtocolCommandId . ConnectionUpdateSecretOk ) ;
125+ ModelRpc ( new ConnectionUpdateSecret ( newSecret , reason ) , ProtocolCommandId . ConnectionUpdateSecretOk ) ;
140126 }
141127
142128 public override void _Private_ExchangeBind ( string destination , string source , string routingKey , bool nowait , IDictionary < string , object > arguments )
143129 {
144- ExchangeBind method = new ExchangeBind ( destination , source , routingKey , nowait , arguments ) ;
130+ var method = new ExchangeBind ( destination , source , routingKey , nowait , arguments ) ;
145131 if ( nowait )
146132 {
147- ModelSend ( ref method ) ;
133+ ModelSend ( method ) ;
148134 }
149135 else
150136 {
151- ModelRpc ( ref method , ProtocolCommandId . ExchangeBindOk ) ;
137+ ModelRpc ( method , ProtocolCommandId . ExchangeBindOk ) ;
152138 }
153139 }
154140
155141 public override void _Private_ExchangeDeclare ( string exchange , string type , bool passive , bool durable , bool autoDelete , bool @internal , bool nowait , IDictionary < string , object > arguments )
156142 {
157- ExchangeDeclare method = new ExchangeDeclare ( exchange , type , passive , durable , autoDelete , @internal , nowait , arguments ) ;
143+ var method = new ExchangeDeclare ( exchange , type , passive , durable , autoDelete , @internal , nowait , arguments ) ;
158144 if ( nowait )
159145 {
160- ModelSend ( ref method ) ;
146+ ModelSend ( method ) ;
161147 }
162148 else
163149 {
164- ModelRpc ( ref method , ProtocolCommandId . ExchangeDeclareOk ) ;
150+ ModelRpc ( method , ProtocolCommandId . ExchangeDeclareOk ) ;
165151 }
166152 }
167153
168154 public override void _Private_ExchangeDelete ( string exchange , bool ifUnused , bool nowait )
169155 {
170- ExchangeDelete method = new ExchangeDelete ( exchange , ifUnused , nowait ) ;
156+ var method = new ExchangeDelete ( exchange , ifUnused , nowait ) ;
171157 if ( nowait )
172158 {
173- ModelSend ( ref method ) ;
159+ ModelSend ( method ) ;
174160 }
175161 else
176162 {
177- ModelRpc ( ref method , ProtocolCommandId . ExchangeDeleteOk ) ;
163+ ModelRpc ( method , ProtocolCommandId . ExchangeDeleteOk ) ;
178164 }
179165 }
180166
181167 public override void _Private_ExchangeUnbind ( string destination , string source , string routingKey , bool nowait , IDictionary < string , object > arguments )
182168 {
183- ExchangeUnbind method = new ExchangeUnbind ( destination , source , routingKey , nowait , arguments ) ;
169+ var method = new ExchangeUnbind ( destination , source , routingKey , nowait , arguments ) ;
184170 if ( nowait )
185171 {
186- ModelSend ( ref method ) ;
172+ ModelSend ( method ) ;
187173 }
188174 else
189175 {
190- ModelRpc ( ref method , ProtocolCommandId . ExchangeUnbindOk ) ;
176+ ModelRpc ( method , ProtocolCommandId . ExchangeUnbindOk ) ;
191177 }
192178 }
193179
194180 public override void _Private_QueueBind ( string queue , string exchange , string routingKey , bool nowait , IDictionary < string , object > arguments )
195181 {
196- QueueBind method = new QueueBind ( queue , exchange , routingKey , nowait , arguments ) ;
182+ var method = new QueueBind ( queue , exchange , routingKey , nowait , arguments ) ;
197183 if ( nowait )
198184 {
199- ModelSend ( ref method ) ;
185+ ModelSend ( method ) ;
200186 }
201187 else
202188 {
203- ModelRpc ( ref method , ProtocolCommandId . QueueBindOk ) ;
189+ ModelRpc ( method , ProtocolCommandId . QueueBindOk ) ;
204190 }
205191 }
206192
207193 public override void _Private_QueueDeclare ( string queue , bool passive , bool durable , bool exclusive , bool autoDelete , bool nowait , IDictionary < string , object > arguments )
208194 {
209- QueueDeclare method = new QueueDeclare ( queue , passive , durable , exclusive , autoDelete , nowait , arguments ) ;
195+ var method = new QueueDeclare ( queue , passive , durable , exclusive , autoDelete , nowait , arguments ) ;
210196 if ( nowait )
211197 {
212- ModelSend ( ref method ) ;
198+ ModelSend ( method ) ;
213199 }
214200 else
215201 {
216- ModelSend ( ref method ) ;
202+ ModelSend ( method ) ;
217203 }
218204 }
219205
220206 public override uint _Private_QueueDelete ( string queue , bool ifUnused , bool ifEmpty , bool nowait )
221207 {
222- QueueDelete method = new QueueDelete ( queue , ifUnused , ifEmpty , nowait ) ;
208+ var method = new QueueDelete ( queue , ifUnused , ifEmpty , nowait ) ;
223209 if ( nowait )
224210 {
225- ModelSend ( ref method ) ;
211+ ModelSend ( method ) ;
226212 return 0xFFFFFFFF ;
227213 }
228214
229- return ModelRpc ( ref method , ProtocolCommandId . QueueDeleteOk , memory => new QueueDeleteOk ( memory . Span ) . _messageCount ) ;
215+ return ModelRpc ( method , ProtocolCommandId . QueueDeleteOk , memory => new QueueDeleteOk ( memory . Span ) . _messageCount ) ;
230216 }
231217
232218 public override uint _Private_QueuePurge ( string queue , bool nowait )
233219 {
234- QueuePurge method = new QueuePurge ( queue , nowait ) ;
220+ var method = new QueuePurge ( queue , nowait ) ;
235221 if ( nowait )
236222 {
237- ModelSend ( ref method ) ;
223+ ModelSend ( method ) ;
238224 return 0xFFFFFFFF ;
239225 }
240226
241- return ModelRpc ( ref method , ProtocolCommandId . QueuePurgeOk , memory => new QueuePurgeOk ( memory . Span ) . _messageCount ) ;
227+ return ModelRpc ( method , ProtocolCommandId . QueuePurgeOk , memory => new QueuePurgeOk ( memory . Span ) . _messageCount ) ;
242228 }
243229
244230 public override void BasicAck ( ulong deliveryTag , bool multiple )
245231 {
246- var cmd = new BasicAck ( deliveryTag , multiple ) ;
247- ModelSend ( ref cmd ) ;
232+ ModelSend ( new BasicAck ( deliveryTag , multiple ) ) ;
248233 }
249234
250235 public override void BasicNack ( ulong deliveryTag , bool multiple , bool requeue )
251236 {
252- var cmd = new BasicNack ( deliveryTag , multiple , requeue ) ;
253- ModelSend ( ref cmd ) ;
237+ ModelSend ( new BasicNack ( deliveryTag , multiple , requeue ) ) ;
254238 }
255239
256240 public override void BasicQos ( uint prefetchSize , ushort prefetchCount , bool global )
257241 {
258- var cmd = new BasicQos ( prefetchSize , prefetchCount , global ) ;
259- ModelRpc ( ref cmd , ProtocolCommandId . BasicQosOk ) ;
242+ ModelRpc ( new BasicQos ( prefetchSize , prefetchCount , global ) , ProtocolCommandId . BasicQosOk ) ;
260243 }
261244
262245 public override void BasicRecoverAsync ( bool requeue )
263246 {
264- var cmd = new BasicRecoverAsync ( requeue ) ;
265- ModelSend ( ref cmd ) ;
247+ ModelSend ( new BasicRecoverAsync ( requeue ) ) ;
266248 }
267249
268250 public override void BasicReject ( ulong deliveryTag , bool requeue )
269251 {
270- var cmd = new BasicReject ( deliveryTag , requeue ) ;
271- ModelSend ( ref cmd ) ;
252+ ModelSend ( new BasicReject ( deliveryTag , requeue ) ) ;
272253 }
273254
274255 public override void QueueUnbind ( string queue , string exchange , string routingKey , IDictionary < string , object > arguments )
275256 {
276- var cmd = new QueueUnbind ( queue , exchange , routingKey , arguments ) ;
277- ModelRpc ( ref cmd , ProtocolCommandId . QueueUnbindOk ) ;
257+ ModelRpc ( new QueueUnbind ( queue , exchange , routingKey , arguments ) , ProtocolCommandId . QueueUnbindOk ) ;
278258 }
279259
280260 public override void TxCommit ( )
281261 {
282- var cmd = new TxCommit ( ) ;
283- ModelRpc ( ref cmd , ProtocolCommandId . TxCommitOk ) ;
262+ ModelRpc ( new TxCommit ( ) , ProtocolCommandId . TxCommitOk ) ;
284263 }
285264
286265 public override void TxRollback ( )
287266 {
288- var cmd = new TxRollback ( ) ;
289- ModelRpc ( ref cmd , ProtocolCommandId . TxRollbackOk ) ;
267+ ModelRpc ( new TxRollback ( ) , ProtocolCommandId . TxRollbackOk ) ;
290268 }
291269
292270 public override void TxSelect ( )
293271 {
294- var cmd = new TxSelect ( ) ;
295- ModelRpc ( ref cmd , ProtocolCommandId . TxSelectOk ) ;
272+ ModelRpc ( new TxSelect ( ) , ProtocolCommandId . TxSelectOk ) ;
296273 }
297274
298275 protected override bool DispatchAsynchronous ( in IncomingCommand cmd )
0 commit comments