From d31838aff1176b8bfbfdeec2c4f9c7f17360342c Mon Sep 17 00:00:00 2001 From: Ben Clayton Date: Fri, 8 Jul 2022 12:17:34 +0000 Subject: [PATCH] tint: Fix x86 build Change-Id: Idb2002dd59cf12e49f75af6174e08258b4331137 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/95840 Commit-Queue: Ben Clayton Reviewed-by: Corentin Wallez Kokoro: Kokoro --- src/tint/writer/text_generator.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/tint/writer/text_generator.cc b/src/tint/writer/text_generator.cc index 1a1fa5abc2..3dabb5caaf 100644 --- a/src/tint/writer/text_generator.cc +++ b/src/tint/writer/text_generator.cc @@ -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(before), Line{indent, line}); + using DT = decltype(lines)::difference_type; + lines.insert(lines.begin() + static_cast
(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(before + idx), + // TODO(bclayton): inefficient, consider optimizing + using DT = decltype(lines)::difference_type; + lines.insert(lines.begin() + static_cast
(before + idx), Line{indent + line.indent, line.content}); idx++; }