From: Hwankyu Jhun Date: Thu, 23 Jun 2022 22:34:33 +0000 (+0900) Subject: Use std::unordered_map instead of std::map X-Git-Tag: accepted/tizen/unified/20220703.214107~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ddb6a094521bbda9a02cbef048997dfefafd76d1;p=platform%2Fcore%2Fbase%2Fbundle.git 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 --- 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_; };