]> git.sur5r.net Git - openldap/commit
ITS#6197 - normalize & speed up ldap_err2string/ldap_perror():
authorHallvard Furuseth <hallvard@openldap.org>
Tue, 7 Jul 2009 20:05:09 +0000 (20:05 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Tue, 7 Jul 2009 20:05:09 +0000 (20:05 +0000)
commitbbe015f65b6003c5708d6294ca4e8502e9ad237d
tree7711858fce02dca355c6ae67744306ca18b732cc
parent461a2135fb980cb2c3608cea8a8df14162114f10
ITS#6197 - normalize & speed up ldap_err2string/ldap_perror():

Use same result code -> string mapping for both, removing ldap_int_error():
- Classify unknown error codes as API/extension/etc like _err2string did.
- Pass all strings through _(), i.e. the optional gettext, as _perror did.

Also use a switch instead of linear search for the code->string mapping.
Hopefully the compiler will optimize that.  Though the extra gettext,
if anyone uses it, probably counters that speedup.
libraries/libldap/error.c