Skip to content

Commit

Permalink
ndjson
Browse files Browse the repository at this point in the history
  • Loading branch information
keith committed Mar 24, 2022
1 parent d14f662 commit d0fbb2b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions tools/worker/compile_with_worker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,7 @@ int CompileWithWorker(const std::vector<std::string> &args) {
// beginning of any process invocation. Note that these arguments include the
// tool itself (i.e., "swiftc").
WorkProcessor swift_worker(args);
int offset = 0;

while (true) {
std::string line;
int result;
do {
char buffer[1024];
lseek(STDIN_FILENO, offset, SEEK_SET);
result = read(STDIN_FILENO, buffer, 1024);
buffer[result] = '\0';
offset += result;
line.append(buffer);
} while (result == 1024);

for (std::string line; std::getline(std::cin, line);) {
if (line == "") {
continue;
}
Expand Down

0 comments on commit d0fbb2b

Please sign in to comment.