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

Commit 312a3ff3 authored by Ryan Mitchell's avatar Ryan Mitchell Committed by android-build-merger
Browse files

Merge "Revert "AAPT: Modified StringPool uniqueness detection"" into pi-dev

am: 61ac5728

Change-Id: Ibd7e47e33d49e6c609b9b73960186020728ac0f5
parents fc01e133 61ac5728
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -172,10 +172,9 @@ StringPool::Ref StringPool::MakeRef(const StringPiece& str, const Context& conte
StringPool::Ref StringPool::MakeRefImpl(const StringPiece& str, const Context& context,
                                        bool unique) {
  if (unique) {
    for (auto& indexed_str : indexed_strings_) {
      if (str == indexed_str.first && context.priority == indexed_str.second->context.priority) {
        return Ref(indexed_str.second);
      }
    auto iter = indexed_strings_.find(str);
    if (iter != std::end(indexed_strings_)) {
      return Ref(iter->second);
    }
  }

+1 −11
Original line number Diff line number Diff line
@@ -61,17 +61,6 @@ TEST(StringPoolTest, DoNotInsertNewDuplicateString) {
  EXPECT_THAT(pool.size(), Eq(1u));
}

TEST(StringPoolTest, DoNotDedupeSameStringDifferentPriority) {
  StringPool pool;

  StringPool::Ref ref_a = pool.MakeRef("wut", StringPool::Context(1));
  StringPool::Ref ref_b = pool.MakeRef("wut", StringPool::Context(2));

  EXPECT_THAT(*ref_a, Eq("wut"));
  EXPECT_THAT(*ref_b, Eq("wut"));
  EXPECT_THAT(pool.size(), Eq(2u));
}

TEST(StringPoolTest, MaintainInsertionOrderIndex) {
  StringPool pool;

@@ -303,6 +292,7 @@ TEST(StringPoolTest, Flatten) {
  }
}


TEST(StringPoolTest, MaxEncodingLength) {
  StdErrDiagnostics diag;
  using namespace android;  // For NO_ERROR on Windows.