OSDN Git Service

Added const qualifier to StringRef::edit_distance member function
authorDmitri Gribenko <gribozavr@gmail.com>
Sat, 24 Aug 2013 01:50:41 +0000 (01:50 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Sat, 24 Aug 2013 01:50:41 +0000 (01:50 +0000)
Patch by Ismail Pazarbasi.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189162 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/StringRef.h
lib/Support/StringRef.cpp

index 3e1e24c..fd5b28e 100644 (file)
@@ -175,7 +175,7 @@ namespace llvm {
     /// transform one of the given strings into the other. If zero,
     /// the strings are identical.
     unsigned edit_distance(StringRef Other, bool AllowReplacements = true,
-                           unsigned MaxEditDistance = 0);
+                           unsigned MaxEditDistance = 0) const;
 
     /// str - Get the contents as an std::string.
     std::string str() const {
index d7a0bfa..ee49ca8 100644 (file)
@@ -85,7 +85,7 @@ int StringRef::compare_numeric(StringRef RHS) const {
 // Compute the edit distance between the two given strings.
 unsigned StringRef::edit_distance(llvm::StringRef Other,
                                   bool AllowReplacements,
-                                  unsigned MaxEditDistance) {
+                                  unsigned MaxEditDistance) const {
   return llvm::ComputeEditDistance(
       llvm::ArrayRef<char>(data(), size()),
       llvm::ArrayRef<char>(Other.data(), Other.size()),