[Lldb-commits] [PATCH] D59562: [SymbolFileDWARF] Introduce	DWARFContext
    Zachary Turner via Phabricator via lldb-commits 
    lldb-commits at lists.llvm.org
       
    Wed Mar 20 13:40:11 PDT 2019
    
    
  
zturner marked an inline comment as done.
zturner added inline comments.
================
Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:552
+  data.Clear();
+  m_obj_file->ReadSectionData(section_sp.get(), data);
 }
----------------
clayborg wrote:
> clayborg wrote:
> > ```
> > if (m_obj_file->ReadSectionData(section_sp.get(), data) == 0)
> >   data.Clear();
> > ```
> What do you think about this one? This is my last nit
I did see that one, but I was having trouble figuring out how the behavior is different from what I already wrote.  The only way I could see it being different is if `ReadSectionData` would actually write data there even when it failed.  That would be strange though, do you know if it can happen?
The way I wrote it, it clears first, and then if the function fails / returns 0, I would expect it to be unchanged.
Happy to change it if there's actually a difference I'm overlooking, but if they're the same then I think the branchless version is slightly easier to read.
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59562/new/
https://reviews.llvm.org/D59562
    
    
More information about the lldb-commits
mailing list