Replace base::flat_map with std::map in privacy math tests
Insertion into flat_map is O(n), but O(log n) for std::map.
Our tests have up to n=150,000.
(cherry picked from commit ad84d282150fe7f8c84fd94e4490d1317d7a7a4a)
Bug: 326980481
Change-Id: Ifd1ded6c594e783c829c2f27bbcbaaa8724b3366
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5350001
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1269138}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5362636
Auto-Submit: Andrew Paseltiner <apaseltiner@chromium.org>
Commit-Queue: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/branch-heads/6312@{#527}
Cr-Branched-From: 6711dcdae48edaf98cbc6964f90fac85b7d9986e-refs/heads/main@{#1262506}
diff --git a/content/browser/attribution_reporting/privacy_math_unittest.cc b/content/browser/attribution_reporting/privacy_math_unittest.cc
index 49634dc..5c6abb2 100644
--- a/content/browser/attribution_reporting/privacy_math_unittest.cc
+++ b/content/browser/attribution_reporting/privacy_math_unittest.cc
@@ -8,10 +8,10 @@
#include <cmath>
#include <limits>
+#include <map>
#include <set>
#include <vector>
-#include "base/containers/flat_map.h"
#include "base/time/time.h"
#include "components/attribution_reporting/event_report_windows.h"
#include "components/attribution_reporting/max_event_level_reports.h"
@@ -381,7 +381,7 @@
const MaxEventLevelReports max_reports,
const int num_samples,
const double tolerance) {
- base::flat_map<std::vector<FakeEventLevelReport>, int> output_counts;
+ std::map<std::vector<FakeEventLevelReport>, int> output_counts;
const absl::uint128 num_states = GetNumStates(specs, max_reports);
internal::StateMap map;
for (int i = 0; i < num_samples; i++) {