summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/malloc-wrapper.c
diff options
context:
space:
mode:
authortb <>2023-12-13 23:28:47 +0000
committertb <>2023-12-13 23:28:47 +0000
commitf9e4eb95614e9427e1bbb5caa4377d07c7fb4f0c (patch)
treefaf01ccc412436a5a29e820afbb97b6c664000be /src/lib/libcrypto/malloc-wrapper.c
parentf9e405c7b1b2503c07f69e9f3f6ffa8e43997514 (diff)
downloadopenbsd-f9e4eb95614e9427e1bbb5caa4377d07c7fb4f0c.tar.gz
openbsd-f9e4eb95614e9427e1bbb5caa4377d07c7fb4f0c.tar.bz2
openbsd-f9e4eb95614e9427e1bbb5caa4377d07c7fb4f0c.zip
Simplify OBJ_obj2nid()
Continue with OBJ_bsearch_() elimination. OBJ_obj2nid() first checks if the object identifier passed in has a nid and if so, it returns that. Otherwise, it looks into the global hash of added objects (of course without locking) for a match and then returns the nid thereof. As a last attempt, it searches the table of built-in object identifiers. The last two steps can be cleaned up and simplified quite a bit by using C99 initializers, bsearch() and an appropriate comparison function. Then it becomes obvious that bsearch() already returns a pointer to the nid we're looking for, so there is no point in converting that into its corresponding obj and returning the nid thereof. ok jsing
Diffstat (limited to 'src/lib/libcrypto/malloc-wrapper.c')
0 files changed, 0 insertions, 0 deletions