Permit and Deny lists in PurpleAccount

Ankit Vani a at nevitus.org
Tue Jul 9 21:29:59 EDT 2013


Hi

Currently, in account.h, there's a TODO:

  /*
   * TODO: Supplementing the next two linked lists with hash tables
   * should help performance a lot when these lists are long.  This
   * matters quite a bit for protocols like MSN, where all your
   * buddies are added to your permit list.  Currently we have to
   * iterate through the entire list if we want to check if someone
   * is permitted or denied.  We should do this for 3.0.0.
   * Or maybe use a GTree.
   */
  GSList *permit;             /**< Permit list.                           */
  GSList *deny;               /**< Deny list.                             */

I had started with hash tables to supplement the linked lists, and soon found
the linked lists to no longer be of any use. I am therefore considering
replacing them with hash tables, and making the appropriate changes to whoever
uses these.

I would like to know if there are any disadvantages to doing so. Such as, would
any protocol depend on the order of values in these lists? Or anything else?

Ankit



More information about the Devel mailing list