]> git.cworth.org Git - empires-server/commitdiff
Trim leading/trailing whitespace when canonizing words
authorCarl Worth <cworth@cworth.org>
Sun, 14 Jun 2020 23:48:56 +0000 (16:48 -0700)
committerCarl Worth <cworth@cworth.org>
Thu, 25 Jun 2020 16:16:04 +0000 (09:16 -0700)
We have a theory that this is what was causing otherwise
identical-looking values to appear next to each other in the judging
lists of recent games.

empathy.js

index 79a0c441218a33b6b3b9219b12ca3d67d18fc8cf..b039a730c4004737c946dad9ae984c0b138c78b4 100644 (file)
@@ -309,7 +309,7 @@ class Empathy extends Game {
   }
 
   canonize(word) {
-    return word.toLowerCase();
+    return word.trim().toLowerCase();
   }
 
   compute_scores() {