diff options
author | Richard Levitte <levitte@openssl.org> | 2017-06-29 21:46:02 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2017-06-29 21:48:12 +0200 |
commit | 6f9c5062682c0f30d62af54b15ad6904e4dd8cb6 (patch) | |
tree | b09168915301d2cf7d1208aaa268d2423dd0b1e2 /crypto | |
parent | 0e288c2af2f24121ebd5f0c58912d9429915c02a (diff) |
STORE: simplify store_loader_cmp()
We have already made sure that the loader scheme isn't NULL, so
checking if they are NULL or not when comparing registered loaders
is redundant. We still soft assert it, just to be entirely sure.
Reviewed-by: Ben Kaduk <kaduk@mit.edu>
(Merged from https://github.com/openssl/openssl/pull/3805)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/store/store_register.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/store/store_register.c b/crypto/store/store_register.c index bde190e78e..c7feec39d6 100644 --- a/crypto/store/store_register.c +++ b/crypto/store/store_register.c @@ -123,11 +123,8 @@ static unsigned long store_loader_hash(const OSSL_STORE_LOADER *v) static int store_loader_cmp(const OSSL_STORE_LOADER *a, const OSSL_STORE_LOADER *b) { - if (a->scheme != NULL && b->scheme != NULL) - return strcmp(a->scheme, b->scheme); - else if (a->scheme == b->scheme) - return 0; - return a->scheme == NULL ? -1 : 1; + assert(a->scheme != NULL && b->scheme != NULL); + return strcmp(a->scheme, b->scheme); } static LHASH_OF(OSSL_STORE_LOADER) *loader_register = NULL; |