From 9507fa2c9545156747a5eb248bc1af3159bfd8c8 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 29 Oct 2015 15:08:57 -0700 Subject: 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 --- runtime/dex_file_test.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'runtime/dex_file_test.cc') 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); } -- cgit v1.2.3-59-g8ed1b