-// Copyright 2015 The Chromium Authors. All rights reserved.
+// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <algorithm>
+#include "base/check.h"
+#include "base/check_op.h"
#include "base/logging.h"
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math.h"
return it == labels_.end() || it->rva_ != rva ? nullptr : &(*it);
}
-void LabelManager::RemoveUnderusedLabels(int32_t count_threshold) {
- if (count_threshold <= 0)
- return;
- labels_.erase(std::remove_if(labels_.begin(), labels_.end(),
- [count_threshold](const Label& label) {
- return label.count_ < count_threshold;
- }),
- labels_.end());
- // Not shrinking |labels_|, since this may cause reallocation.
-}
-
void LabelManager::UnassignIndexes() {
for (Label& label : labels_)
label.index_ = Label::kNoIndex;