~kamstrup/unity-lens-applications/remoteemblems

« back to all changes in this revision

Viewing changes to src/unity-package-search.cc

  • Committer: Mikkel Kamstrup Erlandsen
  • Date: 2011-03-11 09:59:51 UTC
  • Revision ID: mikkel.kamstrup@gmail.com-20110311095951-r4f0jphybn0rb7g0
Slightly more defensive way of looking up random apps

Show diffs side-by-side

added added

removed removed

Lines of Context:
453
453
      for (i = 0, n_unique = 0; i < n_apps*4, n_unique < n_apps; i++)
454
454
        {
455
455
          docid = g_rand_int_range (searcher->random, 0, matches.size ());
456
 
          Xapian::Document doc = searcher->db->get_document (*matches[docid]);
 
456
          Xapian::MSetIterator iter = matches[docid];
 
457
          Xapian::Document doc = iter.get_document ();
457
458
          UnityPackageInfo *pkginfo = _pkginfo_from_document (doc);
458
459
          if (g_hash_table_lookup_extended (unique, pkginfo->package_name, NULL, NULL))
459
460
            {