I noticed and fixed the spacing issue in the function arguments (lines 44 and 45) shortly after mailing the patch.<div><br></div><div>What I'm mainly looking for is approval on the organizational/style aspects of the patch such as the name and location of the header file, etc. The body of llvm::ComputeEditDistance is just the original body of StringRef::edit_distance, modified to use two ArrayRef arguments instead of one StringRef argument and *this. I've verified the patch does not break any llvm or clang unit tests.</div>
<div><br></div><div>The motivation behind this patch is that in clang's typo correction code, I want to compute the "edit distance" of something that is not a string (specifically, the sets of IdentifierInfo pointers that make up two C++ nested name specifiers) and did not want to simply duplicate the body of StringRef::edit_distance in a local function. ;)</div>
<div><br></div><div>Cheers,</div><div>Kaelyn</div><div><br><div class="gmail_quote">On Tue, Feb 14, 2012 at 3:39 PM, Kaelyn Uhrain <span dir="ltr"><<a href="mailto:rikka@google.com">rikka@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Accomplished by moving the body of StringRef::edit_distance into<br>
a separate function that accepts two ArrayRefs, and making<br>
StringRef::edit_distance a wrapper around the new function.<br>
---<br>
 include/llvm/ADT/edit_distance.h |  101 ++++++++++++++++++++++++++++++++++++++<br>
 lib/Support/StringRef.cpp        |   56 ++-------------------<br>
 2 files changed, 106 insertions(+), 51 deletions(-)<br>
 create mode 100644 include/llvm/ADT/edit_distance.h<br>
<br>
</blockquote></div><br></div>