diff --git a/src/lib/yajl/ParseInputStream.cxx b/src/lib/yajl/ParseInputStream.cxx index 722012957..4e8deed21 100644 --- a/src/lib/yajl/ParseInputStream.cxx +++ b/src/lib/yajl/ParseInputStream.cxx @@ -27,17 +27,14 @@ Yajl::ParseInputStream(Handle &handle, InputStream &is) { const std::lock_guard protect(is.mutex); - bool done = false; - - while (!done) { + while (true) { unsigned char buffer[4096]; const size_t nbytes = is.Read(buffer, sizeof(buffer)); if (nbytes == 0) - done = true; + break; - if (done) { - handle.CompleteParse(); - } else - handle.Parse(buffer, nbytes); + handle.Parse(buffer, nbytes); } + + handle.CompleteParse(); }