YugabyteDB (2.13.1.0-b60, 21121d69985fbf76aa6958d8f04a9bfa936293b5)

Coverage Report

Created: 2022-03-22 16:43

/Users/deen/code/yugabyte-db/src/yb/rocksdb/memtable/stl_wrappers.h
Line
Count
Source
1
//  Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
2
//  This source code is licensed under the BSD-style license found in the
3
//  LICENSE file in the root directory of this source tree. An additional grant
4
//  of patent rights can be found in the PATENTS file in the same directory.
5
//
6
// The following only applies to changes made to this file as part of YugaByte development.
7
//
8
// Portions Copyright (c) YugaByte, Inc.
9
//
10
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
11
// in compliance with the License.  You may obtain a copy of the License at
12
//
13
// http://www.apache.org/licenses/LICENSE-2.0
14
//
15
// Unless required by applicable law or agreed to in writing, software distributed under the License
16
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
17
// or implied.  See the License for the specific language governing permissions and limitations
18
// under the License.
19
//
20
#pragma once
21
22
#include <string>
23
24
#include "yb/rocksdb/memtablerep.h"
25
26
#include "yb/util/slice.h"
27
28
namespace rocksdb {
29
namespace stl_wrappers {
30
31
class Base {
32
 protected:
33
  const MemTableRep::KeyComparator& compare_;
34
  explicit Base(const MemTableRep::KeyComparator& compare)
35
31.5k
      : compare_(compare) {}
36
};
37
38
struct Compare : private Base {
39
31.5k
  explicit Compare(const MemTableRep::KeyComparator& compare) : Base(compare) {}
40
66.6M
  inline bool operator()(const char* a, const char* b) const {
41
66.6M
    return compare_(a, b) < 0;
42
66.6M
  }
43
};
44
45
} // namespace stl_wrappers
46
} // namespace rocksdb