summaryrefslogtreecommitdiff
path: root/tools/aapt2/ResourceTable.h
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2018-08-27 11:24:04 -0700
committerRyan Mitchell <rtmitchell@google.com>2018-08-27 22:35:34 +0000
commit8d4ee973fa631c13ad458a3b906d8c1319fe0913 (patch)
tree52bdaa2fda135ea05a60237c281981012bcbc0c7 /tools/aapt2/ResourceTable.h
parent342df6ddd178d55aa94e01ff94e5be00457f3440 (diff)
AAPT2: Fix resource table load time regression
A previous change (deee395) caused duplicate entries to be created for entries eith entry ids greater than 0x0ff. This is because the wrong data type was used (uint8_t instead of uint16_t). This made loading in resources slower as well since more entries had to be iterated over. Bug: 36051266 Test: Dumping all resources in 700 apks found in the android tree took 1 minute instead of 5 minutes. Created a test in aapt2_tests. Change-Id: I1c3d830da517a56ac3496221dbe605c72e0c6014
Diffstat (limited to 'tools/aapt2/ResourceTable.h')
-rw-r--r--tools/aapt2/ResourceTable.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/aapt2/ResourceTable.h b/tools/aapt2/ResourceTable.h
index c40323c34f48..5a43a2d86cfe 100644
--- a/tools/aapt2/ResourceTable.h
+++ b/tools/aapt2/ResourceTable.h
@@ -146,9 +146,10 @@ class ResourceTableType {
explicit ResourceTableType(const ResourceType type) : type(type) {}
- ResourceEntry* FindEntry(const android::StringPiece& name, Maybe<uint8_t> id = Maybe<uint8_t>());
+ ResourceEntry* FindEntry(const android::StringPiece& name,
+ Maybe<uint16_t> id = Maybe<uint16_t>());
ResourceEntry* FindOrCreateEntry(const android::StringPiece& name,
- Maybe<uint8_t> id = Maybe<uint8_t>());
+ Maybe<uint16_t> id = Maybe<uint16_t>());
private:
DISALLOW_COPY_AND_ASSIGN(ResourceTableType);