summaryrefslogtreecommitdiff
path: root/chromium/components/metrics/expired_histograms_checker.cc
blob: 2eb14e7c1b7838e6590ce83d557104ff694c10ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/metrics/expired_histograms_checker.h"

#include <algorithm>

namespace metrics {

ExpiredHistogramsChecker::ExpiredHistogramsChecker(const uint64_t* array,
                                                   size_t size)
    : array_(array), size_(size) {}

ExpiredHistogramsChecker::~ExpiredHistogramsChecker() {}

bool ExpiredHistogramsChecker::ShouldRecord(uint64_t histogram_hash) const {
  return !std::binary_search(array_, array_ + size_, histogram_hash);
}

}  // namespace metrics