Bug 1543393 - shardIndex should not use ceil(); r=chutten

Differential Revision: https://phabricator.services.mozilla.com/D26909

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Liang-Heng Chen 2019-04-11 18:47:28 +00:00
Родитель 1a53df3674
Коммит 6b0c93a5f1
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -213,8 +213,7 @@ nsresult AppEncodeTo(const StaticMutexAutoLock& lock,
return NS_ERROR_FAILURE;
}
MOZ_ASSERT(index < gOriginsList->Length());
size_t shardIndex =
ceil(static_cast<double>(index) / PrioEncoder::gNumBooleans);
size_t shardIndex = index / PrioEncoder::gNumBooleans;
MOZ_ASSERT(shardIndex < metricData.Length());
MOZ_ASSERT(index % PrioEncoder::gNumBooleans <
metricData[shardIndex].Length());
@ -248,8 +247,8 @@ void TelemetryOrigin::InitializeGlobalState() {
// The contents and order of this array matters.
// Both ensure a consistent app-encoding.
gOriginsList = new nsTArray<const char*>({
"doubleclick.de",
"fb.com",
"doubleclick.de",
});
gPrioDatasPerMetric =