mirror of
https://github.com/kerberos-io/openalpr-base.git
synced 2025-10-06 11:26:56 +08:00
Replaced dynamic array initialization with vector.
This commit is contained in:
@@ -276,7 +276,15 @@ int levenshteinDistance (const std::string &s1, const std::string &s2, int max)
|
||||
int len2 = s2.length();
|
||||
max--;
|
||||
|
||||
int matrix[2][len2 + 1];
|
||||
//int matrix[2][len2 + 1];
|
||||
std::vector<std::vector<int> > matrix;
|
||||
for (unsigned int i = 0; i < 2; i++)
|
||||
{
|
||||
std::vector<int> top_elem;
|
||||
matrix.push_back(top_elem);
|
||||
for (unsigned int j = 0; j < len2 + 1; j++)
|
||||
matrix[i].push_back(0);
|
||||
}
|
||||
int i;
|
||||
int j;
|
||||
|
||||
|
Reference in New Issue
Block a user