From ddb6a094521bbda9a02cbef048997dfefafd76d1 Mon Sep 17 00:00:00 2001 From: Hwankyu Jhun Date: Fri, 24 Jun 2022 07:34:33 +0900 Subject: [PATCH] Use std::unordered_map instead of std::map We usally use std::map as like hash table. Sorting key/value is not needed. Change-Id: Id2599c6de939dcc216d3511419429b1b84aa297e Signed-off-by: Hwankyu Jhun --- src/bundle-internal.cc | 6 ++++-- src/bundle-internal.h | 6 +++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/bundle-internal.cc b/src/bundle-internal.cc index 3d14ace..6c3be38 100644 --- a/src/bundle-internal.cc +++ b/src/bundle-internal.cc @@ -14,6 +14,8 @@ * limitations under the License. */ +#include "bundle-internal.h" + #include #include @@ -21,7 +23,6 @@ #include "include/bundle.h" -#include "bundle-internal.h" #include "exception-internal.h" namespace tizen_base { @@ -265,7 +266,8 @@ int Bundle::DecodeRaw(unsigned char* raw, int size) { return BUNDLE_ERROR_NONE; } -const std::map>& Bundle::GetMap() { +const std::unordered_map>& +Bundle::GetMap() const { return map_; } diff --git a/src/bundle-internal.h b/src/bundle-internal.h index 136458a..1b46a73 100644 --- a/src/bundle-internal.h +++ b/src/bundle-internal.h @@ -18,9 +18,9 @@ #define BUNDLE_INTERNAL_H_ #include -#include #include #include +#include #include #include "include/bundle.h" @@ -72,7 +72,7 @@ class Bundle { unsigned char* Encode(); unsigned char* EncodeRaw(int* size); int DecodeRaw(unsigned char* raw, int size); - const std::map>& GetMap(); + const std::unordered_map>& GetMap() const; std::vector Export(); private: @@ -80,7 +80,7 @@ class Bundle { int Import(int argc, char** argv); private: - std::map> map_; + std::unordered_map> map_; std::list> list_; }; -- 2.7.4