summaryrefslogtreecommitdiff
path: root/usr.bin/getent
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-12-13 23:28:48 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-12-13 23:28:48 +0000
commita5087fb35e42fce3dd7d55849cd3a8e4c28723ef (patch)
tree7021e74ffd7502f238428673bdc0a68979076a40 /usr.bin/getent
parentde5e972545b1a7c99895fb8c9bfe5a52657ad352 (diff)
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 'usr.bin/getent')
0 files changed, 0 insertions, 0 deletions