diff options
author | tb <> | 2023-12-13 23:28:47 +0000 |
---|---|---|
committer | tb <> | 2023-12-13 23:28:47 +0000 |
commit | f9e4eb95614e9427e1bbb5caa4377d07c7fb4f0c (patch) | |
tree | faf01ccc412436a5a29e820afbb97b6c664000be /src/lib/libcrypto/malloc-wrapper.c | |
parent | f9e405c7b1b2503c07f69e9f3f6ffa8e43997514 (diff) | |
download | openbsd-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