diff --git a/llvm/include/llvm/ADT/edit_distance.h b/llvm/include/llvm/ADT/edit_distance.h --- a/llvm/include/llvm/ADT/edit_distance.h +++ b/llvm/include/llvm/ADT/edit_distance.h @@ -18,7 +18,6 @@ #include "llvm/ADT/ArrayRef.h" #include -#include namespace llvm { @@ -70,16 +69,8 @@ return MaxEditDistance + 1; } - const unsigned SmallBufferSize = 64; - unsigned SmallBuffer[SmallBufferSize]; - std::unique_ptr Allocated; - unsigned *Row = SmallBuffer; - if (n + 1 > SmallBufferSize) { - Row = new unsigned[n + 1]; - Allocated.reset(Row); - } - - for (unsigned i = 1; i <= n; ++i) + SmallVector Row(n + 1); + for (unsigned i = 1; i < Row.size(); ++i) Row[i] = i; for (typename ArrayRef::size_type y = 1; y <= m; ++y) {