summaryrefslogtreecommitdiff
path: root/sphinx/versioning.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/versioning.py')
-rw-r--r--sphinx/versioning.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/sphinx/versioning.py b/sphinx/versioning.py
index 0b2b1f24f..753629042 100644
--- a/sphinx/versioning.py
+++ b/sphinx/versioning.py
@@ -66,12 +66,11 @@ def get_ratio(old, new):
Returns a "similiarity ratio" representing the similarity between the two
strings where 0 is equal and anything above less than equal.
"""
- if old == new:
- return 0
- ratio = levenshtein_distance(old, new) / (len(old) / 100.0)
- return ratio
+ return levenshtein_distance(old, new) / (len(old) / 100.0)
def levenshtein_distance(a, b):
+ if a == b:
+ return 0
if len(a) < len(b):
a, b = b, a
if not a: