feature: parse coordinates, create the number list
This commit is contained in:
15
src/scan.cpp
15
src/scan.cpp
@@ -104,20 +104,9 @@ namespace wavefront {
|
||||
return max_length;
|
||||
}();
|
||||
|
||||
while (!input.eof()) {
|
||||
std::string line;
|
||||
while (std::getline(input, line)) {
|
||||
++result.total_lines;
|
||||
input.getline(buffer.data(), buffer.size());
|
||||
auto line_size = input.gcount();
|
||||
|
||||
if (input.fail() && line_size == buffer.size()) [[unlikely]] {
|
||||
throw scan_error(std::format(
|
||||
"[{}]: {}",
|
||||
result.total_lines,
|
||||
"Line too long"
|
||||
));
|
||||
}
|
||||
|
||||
std::string_view line(buffer.data(), line_size);
|
||||
|
||||
if (line.empty() || line[0] == '#' || trim(line).empty()) [[unlikely]] {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user