Skip to content

Commit 60d155a

Browse files
committed
[tidy] remove some unused code
1 parent f29f81f commit 60d155a

File tree

4 files changed

+5
-31
lines changed

4 files changed

+5
-31
lines changed

src/document.sections.hh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
#include <map>
3434
#include <set>
35+
#include <optional>
3536
#include <string>
37+
#include <memory>
3638
#include <vector>
3739

3840
#include "base/attr_line.hh"

src/lnav.prompt.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,8 @@ prompt::rl_history(textinput_curses& tc)
511511
case context_t::search:
512512
readline_regex_highlighter(al, std::nullopt);
513513
break;
514+
default:
515+
break;
514516
}
515517
poss.emplace_back(al.move());
516518
};

src/plain_text_source.cc

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -29,27 +29,12 @@
2929

3030
#include "plain_text_source.hh"
3131

32+
#include "base/intern_string.hh"
3233
#include "base/itertools.hh"
3334
#include "config.h"
3435
#include "document.sections.hh"
3536
#include "scn/scan.h"
3637

37-
static std::vector<plain_text_source::text_line>
38-
to_text_line(const std::vector<attr_line_t>& lines)
39-
{
40-
file_off_t off = 0;
41-
42-
return lines | lnav::itertools::map([&off](const auto& elem) {
43-
auto retval = plain_text_source::text_line{
44-
off,
45-
elem,
46-
};
47-
48-
off += elem.length() + 1;
49-
return retval;
50-
});
51-
}
52-
5338
plain_text_source::plain_text_source(const string_fragment& text)
5439
{
5540
size_t start = 0;
@@ -61,17 +46,6 @@ plain_text_source::plain_text_source(const string_fragment& text)
6146
this->tds_longest_line = this->compute_longest_line();
6247
}
6348

64-
plain_text_source::plain_text_source(const std::vector<std::string>& text_lines)
65-
{
66-
this->replace_with(text_lines);
67-
}
68-
69-
plain_text_source::plain_text_source(const std::vector<attr_line_t>& text_lines)
70-
: tds_lines(to_text_line(text_lines))
71-
{
72-
this->tds_longest_line = this->compute_longest_line();
73-
}
74-
7549
plain_text_source&
7650
plain_text_source::replace_with(const attr_line_t& text_lines)
7751
{

src/plain_text_source.hh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ public:
6767

6868
plain_text_source(const string_fragment& text);
6969

70-
plain_text_source(const std::vector<std::string>& text_lines);
71-
72-
plain_text_source(const std::vector<attr_line_t>& text_lines);
73-
7470
plain_text_source& set_reverse_selection(bool val)
7571
{
7672
this->tds_reverse_selection = val;

0 commit comments

Comments
 (0)