Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4204774f authored by Yurii Zubrytskyi's avatar Yurii Zubrytskyi
Browse files

[res] Remove unused fields from ResolvedBag::Entry

The pointers to the key and type string pools were never used,
but they take 20 bytes for each object, doubling its size.

This change reduces the struct size 40 -> 20 bytes, so all
style and array resolution code should get a bit faster

Bug: none
Test: atest libandroidfw_tests
Flag: EXEMPT minor cleanup
Change-Id: I168df90af241a3edd5779b9ef609893b1be1829c
parent b91d3e47
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -1300,8 +1300,6 @@ base::expected<const ResolvedBag*, NullOrIOError> AssetManager2::GetBag(

      new_entry->cookie = entry->cookie;
      new_entry->key = new_key;
      new_entry->key_pool = nullptr;
      new_entry->type_pool = nullptr;
      new_entry->style = resid;
      new_entry->value.copyFrom_dtoh(map_entry->value);
      status_t err = entry->dynamic_ref_table->lookupResourceValue(&new_entry->value);
@@ -1372,8 +1370,6 @@ base::expected<const ResolvedBag*, NullOrIOError> AssetManager2::GetBag(
      // or is equal to the parent (overrides).
      new_entry->cookie = entry->cookie;
      new_entry->key = child_key;
      new_entry->key_pool = nullptr;
      new_entry->type_pool = nullptr;
      new_entry->value.copyFrom_dtoh(map_entry->value);
      new_entry->style = resid;
      status_t err = entry->dynamic_ref_table->lookupResourceValue(&new_entry->value);
@@ -1415,8 +1411,6 @@ base::expected<const ResolvedBag*, NullOrIOError> AssetManager2::GetBag(
    }
    new_entry->cookie = entry->cookie;
    new_entry->key = new_key;
    new_entry->key_pool = nullptr;
    new_entry->type_pool = nullptr;
    new_entry->value.copyFrom_dtoh(map_entry->value);
    new_entry->style = resid;
    status_t err = entry->dynamic_ref_table->lookupResourceValue(&new_entry->value);
+0 −3
Original line number Diff line number Diff line
@@ -59,9 +59,6 @@ struct ResolvedBag {

    // Which ApkAssets this entry came from.
    ApkAssetsCookie cookie;

    ResStringPool* key_pool;
    ResStringPool* type_pool;
  };

  // Denotes the configuration axis that this bag varies with.