Changeset d199207 for perlconfig.c


Ignore:
Timestamp:
Mar 11, 2012, 10:58:01 PM (13 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.10, release-1.9
Children:
3e34a69, 5111af4, d6b8b50
Parents:
a03a409
git-author:
Anders Kaseorg <andersk@mit.edu> (01/19/12 21:32:33)
git-committer:
David Benjamin <davidben@mit.edu> (03/11/12 22:58:01)
Message:
zephyr: Use field iterator interface to avoid quadratic loops

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • perlconfig.c

    r7803326 rd199207  
    7575  const char *type;
    7676  char *ptr, *utype, *blessas;
    77   int i, j;
     77  const char *f;
     78  int i;
    7879  const owl_pair *pair;
    7980  const owl_filter *wrap;
     
    9697
    9798    av_zfields = newAV();
    98     j=owl_zephyr_get_num_fields(owl_message_get_notice(m));
    99     for (i=0; i<j; i++) {
    100       ptr=owl_zephyr_get_field_as_utf8(owl_message_get_notice(m), i+1);
     99    for (f = owl_zephyr_first_raw_field(owl_message_get_notice(m)); f != NULL;
     100         f = owl_zephyr_next_raw_field(owl_message_get_notice(m), f)) {
     101      ptr=owl_zephyr_field_as_utf8(owl_message_get_notice(m), f);
    101102      av_push(av_zfields, owl_new_sv(ptr));
    102103      g_free(ptr);
Note: See TracChangeset for help on using the changeset viewer.