<div dir="ltr">Thanks Jim!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 5, 2019 at 5:27 PM Jim Ingham via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Author: jingham<br>
Date: Tue Feb 5 17:27:45 2019<br>
New Revision: 353257<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=353257&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=353257&view=rev</a><br>
Log:<br>
Little more cleanup on <a href="https://reviews.llvm.org/D57552" rel="noreferrer" target="_blank">https://reviews.llvm.org/D57552</a><br>
Thanks Jonas... One more early continue and using<br>
a range where we had an iterator.<br>
<br>
NFC<br>
<br>
Modified:<br>
lldb/trunk/source/Target/PathMappingList.cpp<br>
<br>
Modified: lldb/trunk/source/Target/PathMappingList.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/PathMappingList.cpp?rev=353257&r1=353256&r2=353257&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/PathMappingList.cpp?rev=353257&r1=353256&r2=353257&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Target/PathMappingList.cpp (original)<br>
+++ lldb/trunk/source/Target/PathMappingList.cpp Tue Feb 5 17:27:45 2019<br>
@@ -211,33 +211,32 @@ bool PathMappingList::FindFile(const Fil<br>
<br>
bool orig_is_relative = orig_spec.IsRelative();<br>
<br>
- const_iterator pos, end = m_pairs.end();<br>
- for (pos = m_pairs.begin(); pos != end; ++pos) {<br>
+ for (auto entry : m_pairs) {<br>
llvm::StringRef orig_ref(orig_path);<br>
- llvm::StringRef prefix_ref = pos->first.GetStringRef();<br>
- if (orig_ref.size() >= prefix_ref.size()) {<br>
- // We consider a relative prefix or one of just "." to<br>
- // mean "only apply to relative paths".<br>
- bool prefix_is_relative = false;<br>
- <br>
- if (prefix_ref == ".") {<br>
- prefix_is_relative = true;<br>
- // Remove the "." since it will have been removed from the<br>
- // FileSpec paths already.<br>
- prefix_ref = prefix_ref.drop_front();<br>
- } else {<br>
- FileSpec prefix_spec(prefix_ref, FileSpec::Style::native);<br>
- prefix_is_relative = prefix_spec.IsRelative();<br>
- }<br>
- if (prefix_is_relative != orig_is_relative)<br>
- continue;<br>
+ llvm::StringRef prefix_ref = entry.first.GetStringRef();<br>
+ if (orig_ref.size() < prefix_ref.size())<br>
+ continue;<br>
+ // We consider a relative prefix or one of just "." to<br>
+ // mean "only apply to relative paths".<br>
+ bool prefix_is_relative = false;<br>
+ <br>
+ if (prefix_ref == ".") {<br>
+ prefix_is_relative = true;<br>
+ // Remove the "." since it will have been removed from the<br>
+ // FileSpec paths already.<br>
+ prefix_ref = prefix_ref.drop_front();<br>
+ } else {<br>
+ FileSpec prefix_spec(prefix_ref, FileSpec::Style::native);<br>
+ prefix_is_relative = prefix_spec.IsRelative();<br>
+ }<br>
+ if (prefix_is_relative != orig_is_relative)<br>
+ continue;<br>
<br>
- if (orig_ref.consume_front(prefix_ref)) {<br>
- new_spec.SetFile(pos->second.GetCString(), FileSpec::Style::native);<br>
- new_spec.AppendPathComponent(orig_ref);<br>
- if (FileSystem::Instance().Exists(new_spec))<br>
- return true;<br>
- }<br>
+ if (orig_ref.consume_front(prefix_ref)) {<br>
+ new_spec.SetFile(entry.second.GetCString(), FileSpec::Style::native);<br>
+ new_spec.AppendPathComponent(orig_ref);<br>
+ if (FileSystem::Instance().Exists(new_spec))<br>
+ return true;<br>
}<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>