[Lldb-commits] [lldb] 12873d1 - Silence unused variable warning in release builds

Benjamin Kramer via lldb-commits lldb-commits at lists.llvm.org
Fri Dec 17 07:07:35 PST 2021


Author: Benjamin Kramer
Date: 2021-12-17T16:07:02+01:00
New Revision: 12873d1a670b4a82b5853dabc8b6ea4d300759af

URL: https://github.com/llvm/llvm-project/commit/12873d1a670b4a82b5853dabc8b6ea4d300759af
DIFF: https://github.com/llvm/llvm-project/commit/12873d1a670b4a82b5853dabc8b6ea4d300759af.diff

LOG: Silence unused variable warning in release builds

lldb/source/Core/DataFileCache.cpp:278:10: warning: unused variable 'pos' [-Wunused-variable]
    auto pos = m_string_to_offset.find(s);
         ^
lldb/source/Core/DataFileCache.cpp:277:18: warning: unused variable 'stroff' [-Wunused-variable]
    const size_t stroff = encoder.GetByteSize() - strtab_offset;
                 ^

Added: 
    

Modified: 
    lldb/source/Core/DataFileCache.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/DataFileCache.cpp b/lldb/source/Core/DataFileCache.cpp
index 8d4dba307a124..3f52b925ef467 100644
--- a/lldb/source/Core/DataFileCache.cpp
+++ b/lldb/source/Core/DataFileCache.cpp
@@ -274,9 +274,8 @@ bool ConstStringTable::Encode(DataEncoder &encoder) {
   encoder.AppendU8(0); // Start the string table with with an empty string.
   for (auto s: m_strings) {
     // Make sure all of the offsets match up with what we handed out!
-    const size_t stroff = encoder.GetByteSize() - strtab_offset;
-    auto pos = m_string_to_offset.find(s);
-    assert(pos->second == stroff);
+    assert(m_string_to_offset.find(s)->second ==
+           encoder.GetByteSize() - strtab_offset);
     // Append the C string into the encoder
     encoder.AppendCString(s.GetStringRef());
   }


        


More information about the lldb-commits mailing list