Changeset 7241 for code/branches/consolecommands3/src/libraries
- Timestamp:
- Aug 28, 2010, 7:03:06 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/consolecommands3/src/libraries/util/StringUtils.cc
r7240 r7241 35 35 36 36 #include <cctype> 37 #include <boost/scoped_array.hpp> 37 38 #include "Convert.h" 38 39 #include "Math.h" … … 538 539 size_t cols = str1.size() + 1; 539 540 size_t rows = str2.size() + 1; 540 int* matrix = new int[rows * cols];541 boost::scoped_array<int> matrix(new int[rows * cols]); 541 542 542 543 for (size_t r = 0; r < rows; ++r) … … 559 560 matrix[(r-1)*cols + c-1] + (str1[c-1] != str2[r-1])); 560 561 561 int result = matrix[(rows-1)*cols + cols-1]; 562 delete[] matrix; 563 return result; 562 return matrix[(rows-1)*cols + cols-1]; 564 563 } 565 564 }
Note: See TracChangeset
for help on using the changeset viewer.