@@ -611,19 +611,24 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a
611
611
} else if (cmd -> proc == setCommand && argc > 3 ) {
612
612
int i ;
613
613
robj * exarg = NULL , * pxarg = NULL ;
614
- /* Translate SET [EX seconds][PX milliseconds] to SET and PEXPIREAT */
615
- buf = catAppendOnlyGenericCommand (buf ,3 ,argv );
616
614
for (i = 3 ; i < argc ; i ++ ) {
617
615
if (!strcasecmp (argv [i ]-> ptr , "ex" )) exarg = argv [i + 1 ];
618
616
if (!strcasecmp (argv [i ]-> ptr , "px" )) pxarg = argv [i + 1 ];
619
617
}
620
618
serverAssert (!(exarg && pxarg ));
621
- if (exarg )
622
- buf = catAppendOnlyExpireAtCommand (buf ,server .expireCommand ,argv [1 ],
623
- exarg );
624
- if (pxarg )
625
- buf = catAppendOnlyExpireAtCommand (buf ,server .pexpireCommand ,argv [1 ],
626
- pxarg );
619
+
620
+ if (exarg || pxarg ) {
621
+ /* Translate SET [EX seconds][PX milliseconds] to SET and PEXPIREAT */
622
+ buf = catAppendOnlyGenericCommand (buf ,3 ,argv );
623
+ if (exarg )
624
+ buf = catAppendOnlyExpireAtCommand (buf ,server .expireCommand ,argv [1 ],
625
+ exarg );
626
+ if (pxarg )
627
+ buf = catAppendOnlyExpireAtCommand (buf ,server .pexpireCommand ,argv [1 ],
628
+ pxarg );
629
+ } else {
630
+ buf = catAppendOnlyGenericCommand (buf ,argc ,argv );
631
+ }
627
632
} else {
628
633
/* All the other commands don't need translation or need the
629
634
* same translation already operated in the command vector
0 commit comments