From 9a2b603b0f753e7c98b0c45e605a4a1faaa988db Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Fri, 20 May 2016 18:34:05 +0200 Subject: [PATCH] rgw, optimization: switch from std::vector to std::array in auth infra. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_auth.cc | 4 +++- src/rgw/rgw_rest_swift.cc | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_auth.cc b/src/rgw/rgw_auth.cc index e73b541cfc0f8..5ab312c37d19c 100644 --- a/src/rgw/rgw_auth.cc +++ b/src/rgw/rgw_auth.cc @@ -1,6 +1,8 @@ // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- // vim: ts=8 sw=2 smarttab +#include + #include "rgw_common.h" #include "rgw_auth.h" #include "rgw_user.h" @@ -418,7 +420,7 @@ RGWKeystoneAuthEngine::get_acl_strategy(const KeystoneToken& token) const const auto& user_name = token.get_user_name(); /* Construct all possible combinations including Swift's wildcards. */ - const std::vector allowed_items = { + const std::array allowed_items = { make_spec_item(tenant_uuid, user_uuid), make_spec_item(tenant_name, user_name), diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index afa7e2d9af2a2..1a55de9759f51 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -17,6 +17,7 @@ #include "rgw_auth_decoimpl.h" #include "rgw_swift_auth.h" +#include #include #include @@ -1517,7 +1518,8 @@ int RGWHandler_REST_SWIFT::authorize() RGWAnonymousAuthEngine anoneng(s->cct, &aplfact); /* Pipeline. */ - const std::vector engines = { + constexpr size_t ENGINES_NUM = 5; + const std::array engines = { &tempurl, &rgwtk, &keystone, &ext, &anoneng }; -- 2.39.5