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
hiredis
Commits
183220bf
Commit
183220bf
authored
Nov 04, 2010
by
Pieter Noordhuis
Browse files
Make moveToNextTask non-recursive
parent
9c4ee606
Changes
1
Show whitespace changes
Inline
Side-by-side
hiredis.c
View file @
183220bf
...
@@ -186,8 +186,7 @@ static char *readLine(redisReader *r, int *_len) {
...
@@ -186,8 +186,7 @@ static char *readLine(redisReader *r, int *_len) {
static
void
moveToNextTask
(
redisReader
*
r
)
{
static
void
moveToNextTask
(
redisReader
*
r
)
{
redisReadTask
*
cur
,
*
prv
;
redisReadTask
*
cur
,
*
prv
;
assert
(
r
->
ridx
>=
0
);
while
(
r
->
ridx
>=
0
)
{
/* Return a.s.a.p. when the stack is now empty. */
/* Return a.s.a.p. when the stack is now empty. */
if
(
r
->
ridx
==
0
)
{
if
(
r
->
ridx
==
0
)
{
r
->
ridx
--
;
r
->
ridx
--
;
...
@@ -199,13 +198,14 @@ static void moveToNextTask(redisReader *r) {
...
@@ -199,13 +198,14 @@ static void moveToNextTask(redisReader *r) {
assert
(
prv
->
type
==
REDIS_REPLY_ARRAY
);
assert
(
prv
->
type
==
REDIS_REPLY_ARRAY
);
if
(
cur
->
idx
==
prv
->
elements
-
1
)
{
if
(
cur
->
idx
==
prv
->
elements
-
1
)
{
r
->
ridx
--
;
r
->
ridx
--
;
moveToNextTask
(
r
);
}
else
{
}
else
{
/* Reset the type because the next item can be anything */
/* Reset the type because the next item can be anything */
assert
(
cur
->
idx
<
prv
->
elements
);
assert
(
cur
->
idx
<
prv
->
elements
);
cur
->
type
=
-
1
;
cur
->
type
=
-
1
;
cur
->
elements
=
-
1
;
cur
->
elements
=
-
1
;
cur
->
idx
++
;
cur
->
idx
++
;
return
;
}
}
}
}
}
...
...
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