Coverage Report

Created: 2026-05-27 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/proc/self/cwd/external/re2~/util/strutil.cc
Line
Count
Source
1
// Copyright 1999-2005 The RE2 Authors.  All Rights Reserved.
2
// Use of this source code is governed by a BSD-style
3
// license that can be found in the LICENSE file.
4
5
#include "util/strutil.h"
6
7
namespace re2 {
8
9
0
void PrefixSuccessor(std::string* prefix) {
10
  // We can increment the last character in the string and be done
11
  // unless that character is 255, in which case we have to erase the
12
  // last character and increment the previous character, unless that
13
  // is 255, etc. If the string is empty or consists entirely of
14
  // 255's, we just return the empty string.
15
0
  while (!prefix->empty()) {
16
0
    char& c = prefix->back();
17
0
    if (c == '\xff') {  // char literal avoids signed/unsigned.
18
0
      prefix->pop_back();
19
0
    } else {
20
0
      ++c;
21
0
      break;
22
0
    }
23
0
  }
24
0
}
25
26
}  // namespace re2