summaryrefslogtreecommitdiff
path: root/runtime/dex_file_test.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-10-29 15:08:57 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-10-29 15:22:00 -0700
commit9507fa2c9545156747a5eb248bc1af3159bfd8c8 (patch)
treef8facbd68dabc781cc4f8e76353a418ef633896e /runtime/dex_file_test.cc
parentc65d1f3d26a47e2fce3c3f8872e7942fec23f9b9 (diff)
Change a few places to use string version of GetTypeId
GetTypeId is about 20% faster than GetStringId + integer GetTypeID since it does less binary searches. Change-Id: I876c4ac89ab206acca217b2287b0197ef2e408c2
Diffstat (limited to 'runtime/dex_file_test.cc')
-rw-r--r--runtime/dex_file_test.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/runtime/dex_file_test.cc b/runtime/dex_file_test.cc
index 90b35a3e04..0a167bb8f7 100644
--- a/runtime/dex_file_test.cc
+++ b/runtime/dex_file_test.cc
@@ -297,6 +297,7 @@ TEST_F(DexFileTest, FindTypeId) {
ASSERT_TRUE(type_str_id != nullptr);
uint32_t type_str_idx = java_lang_dex_file_->GetIndexForStringId(*type_str_id);
const DexFile::TypeId* type_id = java_lang_dex_file_->FindTypeId(type_str_idx);
+ ASSERT_EQ(type_id, java_lang_dex_file_->FindTypeId(type_str));
ASSERT_TRUE(type_id != nullptr);
EXPECT_EQ(java_lang_dex_file_->GetIndexForTypeId(*type_id), i);
}