From 442f8c6d3d42b892e3f13128bcb6487ff7508f0d Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Wed, 19 Jun 2019 16:05:40 -0400 Subject: Make extractLine return a bool. (#991) --- tools/slang-generate/main.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tools/slang-generate/main.cpp') diff --git a/tools/slang-generate/main.cpp b/tools/slang-generate/main.cpp index 7c0e3672a..be06836e7 100644 --- a/tools/slang-generate/main.cpp +++ b/tools/slang-generate/main.cpp @@ -554,15 +554,9 @@ void emitSimpleText( FILE* stream, StringSpan const& span) { - UnownedStringSlice content = span; - while (true) + UnownedStringSlice content(span), line; + while (StringUtil::extractLine(content, line)) { - const auto line = StringUtil::extractLine(content); - if (line.begin() == nullptr) - { - break; - } - // Write the line fwrite(line.begin(), 1, line.size(), stream); -- cgit v1.2.3