summaryrefslogtreecommitdiff
path: root/tools/slang-generate/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/slang-generate/main.cpp')
-rw-r--r--tools/slang-generate/main.cpp10
1 files changed, 2 insertions, 8 deletions
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);