diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-30 03:19:38 +0100 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-11-30 03:36:22 +0100 |
commit | 8088a82a2a91d29967cef920ba780eecdf72518e (patch) | |
tree | d30768bff5805e1209d64e9c0e7e87c38cce0042 /src/crypto/mac | |
parent | 1111dc8e5e9e78254c1a7a891d961713e1be9db0 (diff) | |
download | fastd-8088a82a2a91d29967cef920ba780eecdf72518e.tar fastd-8088a82a2a91d29967cef920ba780eecdf72518e.zip |
Perform string-based lookup of method-related information only once
Diffstat (limited to 'src/crypto/mac')
-rw-r--r-- | src/crypto/mac/macs.c.in | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/crypto/mac/macs.c.in b/src/crypto/mac/macs.c.in index c70473b..ee64362 100644 --- a/src/crypto/mac/macs.c.in +++ b/src/crypto/mac/macs.c.in @@ -106,15 +106,11 @@ const fastd_mac_info_t* fastd_mac_info_get_by_name(const char *name) { return NULL; } -const fastd_mac_t* fastd_mac_get_by_name(fastd_context_t *ctx, const char *name, const fastd_mac_info_t **info) { +const fastd_mac_t* fastd_mac_get(fastd_context_t *ctx, const fastd_mac_info_t *info) { size_t i; for (i = 0; i < array_size(macs); i++) { - if (!strcmp(macs[i].name, name)) { - if (info) - *info = macs[i].info; - + if (macs[i].info == info) return ctx->conf->macs[i]; - } } return NULL; |