aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-02-10 00:45:45 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2018-02-13 23:04:03 +0800
commitdc0a25f1cdd0fe8a8de3a8a9a8376fc77e8de213 (patch)
tree039076fc7d9a6fa9762f50d90b8f0ffe75cd358a /libdevcore
parent8a491c77ba9680afdf8c33664e905b978152b095 (diff)
downloaddexon-solidity-dc0a25f1cdd0fe8a8de3a8a9a8376fc77e8de213.tar.gz
dexon-solidity-dc0a25f1cdd0fe8a8de3a8a9a8376fc77e8de213.tar.zst
dexon-solidity-dc0a25f1cdd0fe8a8de3a8a9a8376fc77e8de213.zip
Minor changes.
Diffstat (limited to 'libdevcore')
-rw-r--r--libdevcore/StringUtils.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/libdevcore/StringUtils.cpp b/libdevcore/StringUtils.cpp
index 1dbe151f..3bdf71f5 100644
--- a/libdevcore/StringUtils.cpp
+++ b/libdevcore/StringUtils.cpp
@@ -34,17 +34,19 @@ bool dev::stringWithinDistance(string const& _str1, string const& _str2, size_t
if (_str1 == _str2)
return true;
- size_t n1 = _str1.size(), n2 = _str2.size();
+ size_t n1 = _str1.size();
+ size_t n2 = _str2.size();
size_t distance = stringDistance(_str1, _str2);
// if distance is not greater than _maxDistance, and distance is strictly less than length of both names, they can be considered similar
// this is to avoid irrelevant suggestions
- return distance <= _maxDistance && distance < n1 && distance < n2;
+ return distance <= _maxDistance && distance < n1 && distance < n2;
}
size_t dev::stringDistance(string const& _str1, string const& _str2)
{
- size_t n1 = _str1.size(), n2 = _str2.size();
+ size_t n1 = _str1.size();
+ size_t n2 = _str2.size();
// Optimize by storing only last 2 rows and current row. So first index is considered modulo 3
vector<vector<size_t>> dp(3, vector<size_t>(n2 + 1));
@@ -73,7 +75,8 @@ size_t dev::stringDistance(string const& _str1, string const& _str2)
return dp[n1 % 3][n2];
}
-string dev::quotedAlternativesList(vector<string> const& suggestions) {
+string dev::quotedAlternativesList(vector<string> const& suggestions)
+{
if (suggestions.empty())
return "";
if (suggestions.size() == 1)