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
753bb3dc
Commit
753bb3dc
authored
Mar 10, 2012
by
antirez
Browse files
More vertical space saved.
parent
c0caa1cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/t_hash.c
View file @
753bb3dc
...
@@ -109,11 +109,9 @@ robj *hashTypeGetObject(robj *o, robj *field) {
...
@@ -109,11 +109,9 @@ robj *hashTypeGetObject(robj *o, robj *field) {
incrRefCount
(
aux
);
incrRefCount
(
aux
);
value
=
aux
;
value
=
aux
;
}
}
}
else
{
}
else
{
redisPanic
(
"Unknown hash encoding"
);
redisPanic
(
"Unknown hash encoding"
);
}
}
return
value
;
return
value
;
}
}
...
@@ -125,21 +123,14 @@ int hashTypeExists(robj *o, robj *field) {
...
@@ -125,21 +123,14 @@ int hashTypeExists(robj *o, robj *field) {
unsigned
int
vlen
=
UINT_MAX
;
unsigned
int
vlen
=
UINT_MAX
;
long
long
vll
=
LLONG_MAX
;
long
long
vll
=
LLONG_MAX
;
if
(
hashTypeGetFromZiplist
(
o
,
field
,
&
vstr
,
&
vlen
,
&
vll
)
==
0
)
{
if
(
hashTypeGetFromZiplist
(
o
,
field
,
&
vstr
,
&
vlen
,
&
vll
)
==
0
)
return
1
;
return
1
;
}
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_HT
)
{
}
else
if
(
o
->
encoding
==
REDIS_ENCODING_HT
)
{
robj
*
aux
;
robj
*
aux
;
if
(
hashTypeGetFromHashTable
(
o
,
field
,
&
aux
)
==
0
)
{
if
(
hashTypeGetFromHashTable
(
o
,
field
,
&
aux
)
==
0
)
return
1
;
return
1
;
}
}
else
{
}
else
{
redisPanic
(
"Unknown hash encoding"
);
redisPanic
(
"Unknown hash encoding"
);
}
}
return
0
;
return
0
;
}
}
...
@@ -303,10 +294,7 @@ int hashTypeNext(hashTypeIterator *hi) {
...
@@ -303,10 +294,7 @@ int hashTypeNext(hashTypeIterator *hi) {
redisAssert
(
vptr
!=
NULL
);
redisAssert
(
vptr
!=
NULL
);
fptr
=
ziplistNext
(
zl
,
vptr
);
fptr
=
ziplistNext
(
zl
,
vptr
);
}
}
if
(
fptr
==
NULL
)
return
REDIS_ERR
;
if
(
fptr
==
NULL
)
{
return
REDIS_ERR
;
}
/* Grab pointer to the value (fptr points to the field) */
/* Grab pointer to the value (fptr points to the field) */
vptr
=
ziplistNext
(
zl
,
fptr
);
vptr
=
ziplistNext
(
zl
,
fptr
);
...
@@ -315,16 +303,11 @@ int hashTypeNext(hashTypeIterator *hi) {
...
@@ -315,16 +303,11 @@ int hashTypeNext(hashTypeIterator *hi) {
/* fptr, vptr now point to the first or next pair */
/* fptr, vptr now point to the first or next pair */
hi
->
fptr
=
fptr
;
hi
->
fptr
=
fptr
;
hi
->
vptr
=
vptr
;
hi
->
vptr
=
vptr
;
}
else
if
(
hi
->
encoding
==
REDIS_ENCODING_HT
)
{
}
else
if
(
hi
->
encoding
==
REDIS_ENCODING_HT
)
{
if
((
hi
->
de
=
dictNext
(
hi
->
di
))
==
NULL
)
{
if
((
hi
->
de
=
dictNext
(
hi
->
di
))
==
NULL
)
return
REDIS_ERR
;
return
REDIS_ERR
;
}
}
else
{
}
else
{
redisPanic
(
"Unknown hash encoding"
);
redisPanic
(
"Unknown hash encoding"
);
}
}
return
REDIS_OK
;
return
REDIS_OK
;
}
}
...
...
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