Depends on bug 76745 strv_extend_strv(a, b) Current implementation: O(|a|*|b|+sum(i in b,strlen(i))) Non-retard implementation: O(|a|+|b|+sum(i in b,strlen(i))) int strv_extend_strv(char ***a, **b){ size_t n=strv_length(*a), m=strv_length(b), i; char **tmp=realloc(*a, sizeof(char*)*(n+m+1)); if(!tmp) return -ENOMEM; *a=tmp; for(i=0;i<m;i++){ tmp[n+i]=strdup(b[i]); if(!tmp[n+i]) return -ENOMEM; } a[n+m]=NULL; return 0; }
Please submit patches to the mailing list, not to Bugzilla.
This is not a patch.
Clearly, it's not a patch. But, because you're suggesting a specific code change, I'm asking you to submit the appropriate patches to the mailing list.
I'm not suggesting this specific implementation. I just think it would be good to have linear strv_extend_strv.
Eh, strv_extend_strv is only used for things where the number of items is ~O(1). Config dirs are limited by implementation to something like 6, and how many modules can you specify on the command line? If you care to provide a patch, then please do so (on the mailing list), but imo current implementation is sufficient.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.