[libc][Obvious] Removed few unused vars.
authorSiva Chandra Reddy <sivachandra@google.com>
Wed, 15 Jun 2022 08:09:12 +0000 (08:09 +0000)
committerSiva Chandra Reddy <sivachandra@google.com>
Wed, 15 Jun 2022 08:13:38 +0000 (08:13 +0000)
libc/src/__support/File/file.cpp

index 7a204c8..249f445 100644 (file)
@@ -128,9 +128,6 @@ size_t File::write_unlocked_fbf(const void *data, size_t len) {
 }
 
 size_t File::write_unlocked_lbf(const void *data, size_t len) {
-  const size_t init_pos = pos;
-  const size_t bufspace = bufsize - pos;
-
   constexpr char NEWLINE_CHAR = '\n';
   size_t last_newline = len;
   for (size_t i = len - 1; i > 0; --i) {
@@ -169,7 +166,7 @@ size_t File::write_unlocked_lbf(const void *data, size_t len) {
   flush_unlocked();
 
   written += write_unlocked_fbf(remainder.data(), remainder.size());
-  if (written < primary.size() + remainder.size()) {
+  if (written < len) {
     err = true;
     return written;
   }