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
d1ec6c8b
Commit
d1ec6c8b
authored
Aug 18, 2011
by
Pieter Noordhuis
Committed by
antirez
Sep 13, 2011
Browse files
Speed up protocol synthesis for AOF
parent
f990782f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
d1ec6c8b
...
@@ -110,17 +110,29 @@ void flushAppendOnlyFile(void) {
...
@@ -110,17 +110,29 @@ void flushAppendOnlyFile(void) {
}
}
}
}
sds
catAppendOnlyGenericCommand
(
sds
buf
,
int
argc
,
robj
**
argv
)
{
sds
catAppendOnlyGenericCommand
(
sds
dst
,
int
argc
,
robj
**
argv
)
{
int
j
;
char
buf
[
32
];
buf
=
sdscatprintf
(
buf
,
"*%d
\r\n
"
,
argc
);
int
len
,
j
;
robj
*
o
;
buf
[
0
]
=
'*'
;
len
=
1
+
ll2string
(
buf
+
1
,
sizeof
(
buf
)
-
1
,
argc
);
buf
[
len
++
]
=
'\r'
;
buf
[
len
++
]
=
'\n'
;
dst
=
sdscatlen
(
dst
,
buf
,
len
);
for
(
j
=
0
;
j
<
argc
;
j
++
)
{
for
(
j
=
0
;
j
<
argc
;
j
++
)
{
robj
*
o
=
getDecodedObject
(
argv
[
j
]);
o
=
getDecodedObject
(
argv
[
j
]);
buf
=
sdscatprintf
(
buf
,
"$%lu
\r\n
"
,(
unsigned
long
)
sdslen
(
o
->
ptr
));
buf
[
0
]
=
'$'
;
buf
=
sdscatlen
(
buf
,
o
->
ptr
,
sdslen
(
o
->
ptr
));
len
=
1
+
ll2string
(
buf
+
1
,
sizeof
(
buf
)
-
1
,
sdslen
(
o
->
ptr
));
buf
=
sdscatlen
(
buf
,
"
\r\n
"
,
2
);
buf
[
len
++
]
=
'\r'
;
buf
[
len
++
]
=
'\n'
;
dst
=
sdscatlen
(
dst
,
buf
,
len
);
dst
=
sdscatlen
(
dst
,
o
->
ptr
,
sdslen
(
o
->
ptr
));
dst
=
sdscatlen
(
dst
,
"
\r\n
"
,
2
);
decrRefCount
(
o
);
decrRefCount
(
o
);
}
}
return
buf
;
return
dst
;
}
}
sds
catAppendOnlyExpireAtCommand
(
sds
buf
,
robj
*
key
,
robj
*
seconds
)
{
sds
catAppendOnlyExpireAtCommand
(
sds
buf
,
robj
*
key
,
robj
*
seconds
)
{
...
...
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