@@ -134,13 +134,9 @@ void ProducerStateTable::set(const string &key, const vector<FieldValueTuple> &v
134
134
args.emplace_back (fvValue (iv));
135
135
}
136
136
137
- // Transform data structure
138
- vector<const char *> args1;
139
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
140
-
141
137
// Invoke redis command
142
138
RedisCommand command;
143
- command.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
139
+ command.format (args );
144
140
m_pipe->push (command, REDIS_REPLY_NIL);
145
141
if (!m_buffered)
146
142
{
@@ -171,13 +167,9 @@ void ProducerStateTable::del(const string &key, const string &op /*= DEL_COMMAND
171
167
args.emplace_back (" ''" );
172
168
args.emplace_back (" ''" );
173
169
174
- // Transform data structure
175
- vector<const char *> args1;
176
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
177
-
178
170
// Invoke redis command
179
171
RedisCommand command;
180
- command.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
172
+ command.format (args );
181
173
m_pipe->push (command, REDIS_REPLY_NIL);
182
174
if (!m_buffered)
183
175
{
@@ -224,13 +216,9 @@ void ProducerStateTable::set(const std::vector<KeyOpFieldsValuesTuple>& values)
224
216
}
225
217
}
226
218
227
- // Transform data structure
228
- vector<const char *> args1;
229
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
230
-
231
219
// Invoke redis command
232
220
RedisCommand command;
233
- command.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
221
+ command.format (args );
234
222
m_pipe->push (command, REDIS_REPLY_NIL);
235
223
if (!m_buffered)
236
224
{
@@ -265,13 +253,9 @@ void ProducerStateTable::del(const std::vector<std::string>& keys)
265
253
}
266
254
args.emplace_back (" G" );
267
255
268
- // Transform data structure
269
- vector<const char *> args1;
270
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
271
-
272
256
// Invoke redis command
273
257
RedisCommand command;
274
- command.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
258
+ command.format (args );
275
259
m_pipe->push (command, REDIS_REPLY_NIL);
276
260
if (!m_buffered)
277
261
{
@@ -307,13 +291,9 @@ void ProducerStateTable::clear()
307
291
args.emplace_back (getStateHashPrefix () + getTableName ());
308
292
args.emplace_back (getDelKeySetName ());
309
293
310
- // Transform data structure
311
- vector<const char *> args1;
312
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
313
-
314
294
// Invoke redis command
315
295
RedisCommand cmd;
316
- cmd.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
296
+ cmd.format (args );
317
297
m_pipe->push (cmd, REDIS_REPLY_NIL);
318
298
m_pipe->flush ();
319
299
}
@@ -466,13 +446,9 @@ void ProducerStateTable::apply_temp_view()
466
446
SWSS_LOG_DEBUG (" apply_view.lua is called with following argument list: %s" , ss.str ().c_str ());
467
447
}
468
448
469
- // Transform data structure
470
- vector<const char *> args1;
471
- transform (args.begin (), args.end (), back_inserter (args1), [](const string &s) { return s.c_str (); } );
472
-
473
449
// Invoke redis command
474
450
RedisCommand command;
475
- command.formatArgv (( int )args1. size (), &args1[ 0 ], NULL );
451
+ command.format (args );
476
452
m_pipe->push (command, REDIS_REPLY_NIL);
477
453
m_pipe->flush ();
478
454
0 commit comments