#include "llvm/ADT/ArrayRef.h"
#include <algorithm>
-#include <memory>
namespace llvm {
return MaxEditDistance + 1;
}
- const unsigned SmallBufferSize = 64;
- unsigned SmallBuffer[SmallBufferSize];
- std::unique_ptr<unsigned[]> Allocated;
- unsigned *Row = SmallBuffer;
- if (n + 1 > SmallBufferSize) {
- Row = new unsigned[n + 1];
- Allocated.reset(Row);
- }
-
- for (unsigned i = 1; i <= n; ++i)
+ SmallVector<unsigned, 64> Row(n + 1);
+ for (unsigned i = 1; i < Row.size(); ++i)
Row[i] = i;
for (typename ArrayRef<T>::size_type y = 1; y <= m; ++y) {