Changeset ce68f23 for perlconfig.c
- Timestamp:
- Jun 25, 2011, 3:26:16 AM (13 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- c266281
- Parents:
- 3cdd6d2
- git-author:
- David Benjamin <davidben@mit.edu> (06/11/11 20:06:46)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/25/11 03:26:16)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
perlconfig.c
rf9df2f0 rce68f23 36 36 } 37 37 38 CALLER_OWN AV *owl_new_av(const owl_list*l, SV *(*to_sv)(const void *))38 CALLER_OWN AV *owl_new_av(const GPtrArray *l, SV *(*to_sv)(const void *)) 39 39 { 40 40 AV *ret; … … 44 44 ret = newAV(); 45 45 46 for (i = 0; i < owl_list_get_size(l); i++) {47 element = owl_list_get_element(l, i);46 for (i = 0; i < l->len; i++) { 47 element = l->pdata[i]; 48 48 av_push(ret, to_sv(element)); 49 49 } … … 55 55 { 56 56 HV *ret; 57 owl_list l;57 GPtrArray *keys; 58 58 const char *key; 59 59 void *element; … … 63 63 64 64 /* TODO: add an iterator-like interface to owl_dict */ 65 owl_list_create(&l); 66 owl_dict_get_keys(d, &l); 67 for (i = 0; i < owl_list_get_size(&l); i++) { 68 key = owl_list_get_element(&l, i); 65 keys = owl_dict_get_keys(d); 66 for (i = 0; i < keys->len; i++) { 67 key = keys->pdata[i]; 69 68 element = owl_dict_find_element(d, key); 70 69 (void)hv_store(ret, key, strlen(key), to_sv(element), 0); 71 70 } 72 owl_ list_cleanup(&l, g_free);71 owl_ptr_array_free(keys, g_free); 73 72 74 73 return ret;
Note: See TracChangeset
for help on using the changeset viewer.