[libc-commits] [libc] 0f72a0d - [libc][Obvious] Removed few unused vars.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Wed Jun 15 01:14:10 PDT 2022


Author: Siva Chandra Reddy
Date: 2022-06-15T08:13:38Z
New Revision: 0f72a0d2aea33b2264daa90f9127c31934ef98d1

URL: https://github.com/llvm/llvm-project/commit/0f72a0d2aea33b2264daa90f9127c31934ef98d1
DIFF: https://github.com/llvm/llvm-project/commit/0f72a0d2aea33b2264daa90f9127c31934ef98d1.diff

LOG: [libc][Obvious] Removed few unused vars.

Added: 
    

Modified: 
    libc/src/__support/File/file.cpp

Removed: 
    


################################################################################
diff  --git a/libc/src/__support/File/file.cpp b/libc/src/__support/File/file.cpp
index 7a204c83a707b..249f44549d4d6 100644
--- a/libc/src/__support/File/file.cpp
+++ b/libc/src/__support/File/file.cpp
@@ -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;
   }


        


More information about the libc-commits mailing list