[Lldb-commits] [PATCH] D70774: [lldb] NFC: refactor CompileUnit::ResolveSymbolContext

Konrad Wilhelm Kleine via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Nov 27 01:55:22 PST 2019


kwk created this revision.
Herald added a reviewer: jdoerfert.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
kwk planned changes to this revision.

I found the above named method hard to read because it had

a) many nested blocks and
b) one return statement at the end with some logic involved.

I decided to refactor this function by employing an early exit strategy.
In order to capture the logic in the return statement and to not have it
repeated more than once I chose to implement a very small lamda function
that captures all the variables it needs.

This is a non-functional change (NFC).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70774

Files:
  lldb/source/Symbol/CompileUnit.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70774.231200.patch
Type: text/x-patch
Size: 6092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20191127/939e3f9a/attachment-0001.bin>


More information about the lldb-commits mailing list