~sethj/ubuntu/wily/unity/fix-for-1445595

« back to all changes in this revision

Viewing changes to UnityCore/DBusIndicators.cpp

  • Committer: Marco Trevisan (Treviño)
  • Date: 2015-02-03 09:46:48 UTC
  • mto: (3899.5.3 panel-titles-fixes)
  • mto: This revision was merged to the branch mainline in revision 3920.
  • Revision ID: mail@3v1n0.net-20150203094648-5a4z0fd462y5aa9u
Unity: Use unordered_map whenever possible

As iterating over it seems just fast as in the ordered version, we just speedup lookups and insertions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
  glib::Source::UniquePtr show_entry_idle_;
76
76
  glib::Source::UniquePtr show_appmenu_idle_;
77
77
  std::vector<std::string> icon_paths_;
78
 
  std::map<std::string, EntryLocationMap> cached_locations_;
 
78
  std::unordered_map<std::string, EntryLocationMap> cached_locations_;
79
79
};
80
80
 
81
81
 
335
335
  gboolean      image_visible   = false;
336
336
  gint32        priority        = -1;
337
337
 
338
 
  std::map<Indicator::Ptr, Indicator::Entries> indicators;
 
338
  std::unordered_map<Indicator::Ptr, Indicator::Entries> indicators;
339
339
 
340
340
  g_variant_get(args, "(" ENTRY_ARRAY_SIGNATURE ")", &iter);
341
341
  while (g_variant_iter_loop(iter, ENTRY_SIGNATURE,
393
393
  }
394
394
  g_variant_iter_free(iter);
395
395
 
396
 
  for (auto i = indicators.begin(), end = indicators.end(); i != end; ++i)
397
 
  {
398
 
    i->first->Sync(indicators[i->first]);
399
 
  }
 
396
  for (auto const& i : indicators)
 
397
    i.first->Sync(i.second);
400
398
}
401
399
 
402
400
void DBusIndicators::Impl::SyncGeometries(std::string const& name,