[llvm] r189162 - Added const qualifier to StringRef::edit_distance member function
Dmitri Gribenko
gribozavr at gmail.com
Fri Aug 23 18:50:41 PDT 2013
Author: gribozavr
Date: Fri Aug 23 20:50:41 2013
New Revision: 189162
URL: http://llvm.org/viewvc/llvm-project?rev=189162&view=rev
Log:
Added const qualifier to StringRef::edit_distance member function
Patch by Ismail Pazarbasi.
Modified:
llvm/trunk/include/llvm/ADT/StringRef.h
llvm/trunk/lib/Support/StringRef.cpp
Modified: llvm/trunk/include/llvm/ADT/StringRef.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/StringRef.h?rev=189162&r1=189161&r2=189162&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/StringRef.h (original)
+++ llvm/trunk/include/llvm/ADT/StringRef.h Fri Aug 23 20:50:41 2013
@@ -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 {
Modified: llvm/trunk/lib/Support/StringRef.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/StringRef.cpp?rev=189162&r1=189161&r2=189162&view=diff
==============================================================================
--- llvm/trunk/lib/Support/StringRef.cpp (original)
+++ llvm/trunk/lib/Support/StringRef.cpp Fri Aug 23 20:50:41 2013
@@ -85,7 +85,7 @@ int StringRef::compare_numeric(StringRef
// 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()),
More information about the llvm-commits
mailing list