summaryrefslogtreecommitdiff
path: root/core/string
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-01-27 21:16:20 +0100
committerGitHub <noreply@github.com>2021-01-27 21:16:20 +0100
commit976e768e71310766ac3927118b15eee03a15cfdb (patch)
treeae4102e4286723456653483856db0f1255543324 /core/string
parent9d3a9b3e7dff8a3645fbb7fe95cd1e8141ba1802 (diff)
parent1be0d6b30e673b209fa8b1f2aa77995c9534df5e (diff)
Merge pull request #45489 from aaronfranke/core
Type consistencies in core
Diffstat (limited to 'core/string')
-rw-r--r--core/string/ustring.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 49cb444837..64311a7cd7 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -1409,8 +1409,9 @@ String String::num(double p_num, int p_decimals) {
if (digit == MAX_DIGITS) //no point in going to infinite
break;
- if ((dec - (double)((int)dec)) < 1e-6)
+ if (dec - (double)((int)dec) < 1e-6) {
break;
+ }
}
if (digit == p_decimals)
@@ -3255,8 +3256,8 @@ float String::similarity(const String &p_string) const {
int src_size = src_bigrams.size();
int tgt_size = tgt_bigrams.size();
- double sum = src_size + tgt_size;
- double inter = 0;
+ int sum = src_size + tgt_size;
+ int inter = 0;
for (int i = 0; i < src_size; i++) {
for (int j = 0; j < tgt_size; j++) {
if (src_bigrams[i] == tgt_bigrams[j]) {