| 311 | } |
| 312 | |
| 313 | const DexFile::StringId* DexFile::FindStringId(const char* string) const { |
| 314 | int32_t lo = 0; |
| 315 | int32_t hi = NumStringIds() - 1; |
| 316 | while (hi >= lo) { |
| 317 | int32_t mid = (hi + lo) / 2; |
| 318 | const DexFile::StringId& str_id = GetStringId(dex::StringIndex(mid)); |
| 319 | const char* str = GetStringData(str_id); |
| 320 | int compare = CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues(string, str); |
| 321 | if (compare > 0) { |
| 322 | lo = mid + 1; |
| 323 | } else if (compare < 0) { |
| 324 | hi = mid - 1; |
| 325 | } else { |
| 326 | return &str_id; |
| 327 | } |
| 328 | } |
| 329 | return nullptr; |
| 330 | } |
| 331 | |
| 332 | const DexFile::TypeId* DexFile::FindTypeId(const char* string) const { |
| 333 | int32_t lo = 0; |
nothing calls this directly
no test coverage detected