Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
2b0f03e4
Commit
2b0f03e4
authored
Jun 22, 2017
by
xuzhou
Committed by
antirez
Jun 22, 2017
Browse files
Optimize set command with ex/px when updating aof.
parent
ad949f23
Changes
1
Show whitespace changes
Inline
Side-by-side
src/aof.c
View file @
2b0f03e4
...
@@ -536,16 +536,16 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a
...
@@ -536,16 +536,16 @@ void feedAppendOnlyFile(struct redisCommand *cmd, int dictid, robj **argv, int a
buf
=
catAppendOnlyGenericCommand
(
buf
,
3
,
tmpargv
);
buf
=
catAppendOnlyGenericCommand
(
buf
,
3
,
tmpargv
);
decrRefCount
(
tmpargv
[
0
]);
decrRefCount
(
tmpargv
[
0
]);
buf
=
catAppendOnlyExpireAtCommand
(
buf
,
cmd
,
argv
[
1
],
argv
[
2
]);
buf
=
catAppendOnlyExpireAtCommand
(
buf
,
cmd
,
argv
[
1
],
argv
[
2
]);
}
else
if
(
cmd
->
proc
==
setCommand
)
{
}
else
if
(
cmd
->
proc
==
setCommand
&&
argc
>
3
)
{
int
i
;
int
i
;
robj
*
exarg
=
NULL
,
*
pxarg
=
NULL
;
robj
*
exarg
=
NULL
,
*
pxarg
=
NULL
;
/* Translate SET [EX seconds][PX milliseconds] to SET and PEXPIREAT */
/* Translate SET [EX seconds][PX milliseconds] to SET and PEXPIREAT */
buf
=
catAppendOnlyGenericCommand
(
buf
,
3
,
argv
);
buf
=
catAppendOnlyGenericCommand
(
buf
,
3
,
argv
);
for
(
i
=
3
;
i
<
argc
;
i
++
)
{
for
(
i
=
3
;
i
<
argc
;
i
++
)
{
if
(
sdsEncodedObject
(
argv
[
i
])
&&
!
strcasecmp
(
argv
[
i
]
->
ptr
,
"ex"
))
if
(
!
strcasecmp
(
argv
[
i
]
->
ptr
,
"ex"
))
exarg
=
argv
[
i
+
1
];
exarg
=
argv
[
i
+
1
];
if
(
sdsEncodedObject
(
argv
[
i
])
&&
!
strcasecmp
(
argv
[
i
]
->
ptr
,
"px"
))
if
(
!
strcasecmp
(
argv
[
i
]
->
ptr
,
"px"
))
pxarg
=
argv
[
i
+
1
];
pxarg
=
argv
[
i
+
1
];
}
}
serverAssert
(
!
(
exarg
&&
pxarg
));
serverAssert
(
!
(
exarg
&&
pxarg
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment