X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f Date: Mon, 14 Mar 2016 13:00:06 -0400 Message-Id: <201603141700.u2EH06la024493@envy.delorie.com> From: DJ Delorie To: geda-user AT delorie DOT com In-reply-to: (gedau AT igor2 DOT repo DOT hu) Subject: Re: [geda-user] pcb: more memory leaks References: Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > not a leak, just wondering: hid/common/flags.c:hid_find_init() why > do we implement bsearch() in the second half of the function instead > of just calling it, especially that we did not implement our own > qsort()? bsearch() should be as portable as qsort() - both are > C89. (In pcb-rnd I've replaced the whole thing with a > string->pointer hash, so I don't need a linked list, an array and a > flag to remember whether the array is sorted, etc - shorter, > simpler, faster code (r1261)). binary search is so simple to implement, that using bsearch() would not have saved that many bytes and/or cycles. A hash would make more sense but I was going for "what can I type in the fastest" :-)