Remove tint::Source::data_view
It's just a view on another field. It doesn't add anything. Change-Id: I52c1939c455d48c067c9c31938be87671328d263 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110560 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Auto-Submit: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
6a4c918cbf
commit
e412c8d8c6
|
@ -113,13 +113,10 @@ std::vector<std::string_view> CopyRelativeStringViews(const std::vector<std::str
|
|||
|
||||
} // namespace
|
||||
|
||||
Source::FileContent::FileContent(const std::string& body)
|
||||
: data(body), data_view(data), lines(SplitLines(data_view)) {}
|
||||
Source::FileContent::FileContent(const std::string& body) : data(body), lines(SplitLines(data)) {}
|
||||
|
||||
Source::FileContent::FileContent(const FileContent& rhs)
|
||||
: data(rhs.data),
|
||||
data_view(data),
|
||||
lines(CopyRelativeStringViews(rhs.lines, rhs.data_view, data_view)) {}
|
||||
: data(rhs.data), lines(CopyRelativeStringViews(rhs.lines, rhs.data, data)) {}
|
||||
|
||||
Source::FileContent::~FileContent() = default;
|
||||
|
||||
|
|
|
@ -43,8 +43,6 @@ class Source {
|
|||
|
||||
/// The original un-split file content
|
||||
const std::string data;
|
||||
/// A string_view over #data
|
||||
const std::string_view data_view;
|
||||
/// #data split by lines
|
||||
const std::vector<std::string_view> lines;
|
||||
};
|
||||
|
|
|
@ -31,7 +31,6 @@ using SourceFileContentTest = testing::Test;
|
|||
TEST_F(SourceFileContentTest, Init) {
|
||||
Source::FileContent fc(kSource);
|
||||
EXPECT_EQ(fc.data, kSource);
|
||||
EXPECT_EQ(fc.data_view, kSource);
|
||||
ASSERT_EQ(fc.lines.size(), 3u);
|
||||
EXPECT_EQ(fc.lines[0], "line one");
|
||||
EXPECT_EQ(fc.lines[1], "line two");
|
||||
|
@ -43,7 +42,6 @@ TEST_F(SourceFileContentTest, CopyInit) {
|
|||
Source::FileContent fc{*src};
|
||||
src.reset();
|
||||
EXPECT_EQ(fc.data, kSource);
|
||||
EXPECT_EQ(fc.data_view, kSource);
|
||||
ASSERT_EQ(fc.lines.size(), 3u);
|
||||
EXPECT_EQ(fc.lines[0], "line one");
|
||||
EXPECT_EQ(fc.lines[1], "line two");
|
||||
|
@ -55,7 +53,6 @@ TEST_F(SourceFileContentTest, MoveInit) {
|
|||
Source::FileContent fc{std::move(*src)};
|
||||
src.reset();
|
||||
EXPECT_EQ(fc.data, kSource);
|
||||
EXPECT_EQ(fc.data_view, kSource);
|
||||
ASSERT_EQ(fc.lines.size(), 3u);
|
||||
EXPECT_EQ(fc.lines[0], "line one");
|
||||
EXPECT_EQ(fc.lines[1], "line two");
|
||||
|
|
Loading…
Reference in New Issue