diff options
author | Eric Haszlakiewicz <erh+git@nimenees.com> | 2015-03-04 03:10:10 +0000 |
---|---|---|
committer | Eric Haszlakiewicz <erh+git@nimenees.com> | 2015-03-04 03:10:10 +0000 |
commit | 484ca368f07054cde67cea5a5fa43ce3b049e667 (patch) | |
tree | f7bd4750fa5656a162d127f8ca9b7401da9059cf /json_object.c | |
parent | a500c1f0b5da18a4108e1844fc50fc2ed4c75a86 (diff) | |
download | json-c-484ca368f07054cde67cea5a5fa43ce3b049e667.tar.gz |
Slight style tweaks to the bsearch changest.
Diffstat (limited to 'json_object.c')
-rw-r--r-- | json_object.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/json_object.c b/json_object.c index c858a9e..9b89bb7 100644 --- a/json_object.c +++ b/json_object.c @@ -892,18 +892,16 @@ void json_object_array_sort(struct json_object *jso, int(*sort_fn)(const void *, struct json_object* json_object_array_bsearch( const struct json_object *key, const struct json_object *jso, - int (*sort_fn)(const void *, const void *) ) + int (*sort_fn)(const void *, const void *)) { struct json_object **result; - result = (struct json_object **) array_list_bsearch( - (const void **) &key, jso->o.c_array, sort_fn ); + result = (struct json_object **)array_list_bsearch( + (const void **)&key, jso->o.c_array, sort_fn); - if ( result == NULL ) { + if (!result) return NULL; - } else { - return *result; - } + return *result; } int json_object_array_length(struct json_object *jso) |