[gnome-weather] search-provider: Fix typo



commit bba268e219ede3e5ddd71f8eef814bf0f0083bb4
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jun 27 20:22:13 2014 +0200

    search-provider: Fix typo
    
    Obviously we want to normalizeCasefoldAndUnaccent term[j]. Assigning
    it to some other location in the array (ie. term[i]) will corrupt it
    by irreversibly overwriting some of the values.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=732344

 src/service/searchProvider.js |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/src/service/searchProvider.js b/src/service/searchProvider.js
index aaaefd2..2631de9 100644
--- a/src/service/searchProvider.js
+++ b/src/service/searchProvider.js
@@ -126,11 +126,11 @@ const SearchProvider = new Lang.Class({
             let country = Util.normalizeCasefoldAndUnaccent(getCountryName(location));
             let good = true;
             for (let j = 0; j < terms.length && good; j++) {
-                terms[i] = Util.normalizeCasefoldAndUnaccent(terms[j]);
+                terms[j] = Util.normalizeCasefoldAndUnaccent(terms[j]);
 
-                good = (name.indexOf(terms[i]) >= 0) ||
-                    (city.indexOf(terms[i]) >= 0) ||
-                    (country.indexOf(terms[i]) >= 0);
+                good = (name.indexOf(terms[j]) >= 0) ||
+                    (city.indexOf(terms[j]) >= 0) ||
+                    (country.indexOf(terms[j]) >= 0);
 
                 //log ('Comparing %s against (%s, %s, %s): %s'.format(terms[i],
                 //                                                    name, city, country, good));


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]