mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-07 19:34:56 +00:00
parent
b60b591d06
commit
12ea494477
@ -526,17 +526,14 @@ class Genode::File_content
|
||||
template <typename STRING, typename FN>
|
||||
void for_each_line(FN const &fn) const
|
||||
{
|
||||
if (_buffer.size == 0)
|
||||
return;
|
||||
|
||||
char const *src = _buffer.ptr;
|
||||
char const *curr_line = src;
|
||||
size_t curr_line_len = 0;
|
||||
|
||||
for (size_t n = 0; ; n++) {
|
||||
|
||||
char const c = *src++;
|
||||
bool const end_of_data = (c == 0 || n == _buffer.size);
|
||||
char const c = (n == _buffer.size) ? 0 : *src++;
|
||||
bool const end_of_data = (c == 0);
|
||||
bool const end_of_line = (c == '\n');
|
||||
|
||||
if (!end_of_data && !end_of_line) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user