On Jan 15, 2009, at 12:36 AM, Gregory Jefferis wrote:
Hello,I've factored out my DOI parsing into an NSString category. I wondered1) if this looks ok (I know it works) http://pastie.org/361295 or see below
Looks fine to me... matchAtIndex:n returns nil if n > the match count, right?
2) where the best place to put it is. Right now it's in BibItem_PubMedLookup
FWIW...I don't think there's much point in making it a category method until it's needed in multiple places. I like static functions near the call point, but that's just me :).
3) is it worthwhile/possible trying to make the regexes static if it getsused a lot?
It's likely not worth the memory overhead unless it's called thousands of times in a loop (i.e. during file parse/save). I've gone overboard on statics in various places.
-- Adam
smime.p7s
Description: S/MIME cryptographic signature
------------------------------------------------------------------------------ This SF.net email is sponsored by: SourcForge Community SourceForge wants to tell your story. http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________ Bibdesk-develop mailing list Bibdesk-develop@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bibdesk-develop