tint: Fix x86 build

Change-Id: Idb2002dd59cf12e49f75af6174e08258b4331137
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95840
Commit-Queue: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
Ben Clayton 2022-07-08 12:17:34 +00:00 committed by Dawn LUCI CQ
parent 2468978f0b
commit d31838aff1
1 changed files with 6 additions and 4 deletions

View File

@ -84,12 +84,13 @@ void TextGenerator::TextBuffer::Insert(const std::string& line, size_t before, u
<< " lines.size(): " << lines.size();
return;
}
lines.insert(lines.begin() + static_cast<int64_t>(before), Line{indent, line});
using DT = decltype(lines)::difference_type;
lines.insert(lines.begin() + static_cast<DT>(before), Line{indent, line});
}
void TextGenerator::TextBuffer::Append(const TextBuffer& tb) {
for (auto& line : tb.lines) {
// TODO(bclayton): inefficent, consider optimizing
// TODO(bclayton): inefficient, consider optimizing
lines.emplace_back(Line{current_indent + line.indent, line.content});
}
}
@ -104,8 +105,9 @@ void TextGenerator::TextBuffer::Insert(const TextBuffer& tb, size_t before, uint
}
size_t idx = 0;
for (auto& line : tb.lines) {
// TODO(bclayton): inefficent, consider optimizing
lines.insert(lines.begin() + static_cast<int64_t>(before + idx),
// TODO(bclayton): inefficient, consider optimizing
using DT = decltype(lines)::difference_type;
lines.insert(lines.begin() + static_cast<DT>(before + idx),
Line{indent + line.indent, line.content});
idx++;
}