Revision: 11885
http://bibdesk.svn.sourceforge.net/bibdesk/?rev=11885&view=rev
Author: hofman
Date: 2007-12-12 12:38:10 -0800 (Wed, 12 Dec 2007)
Log Message:
-----------
Reduce calls to check for empty complex strings.
Modified Paths:
--------------
trunk/bibdesk/BibItem.m
Modified: trunk/bibdesk/BibItem.m
===================================================================
--- trunk/bibdesk/BibItem.m 2007-12-12 20:33:59 UTC (rev 11884)
+++ trunk/bibdesk/BibItem.m 2007-12-12 20:38:10 UTC (rev 11885)
@@ -1181,19 +1181,21 @@
- (NSString *)valueOfField: (NSString *)key inherit: (BOOL)inherit{
NSString *value = [pubFields objectForKey:key];
+ BOOL isEmpty = [NSString isEmptyAsComplexString:value];
- if (inherit && [NSString isEmptyAsComplexString:value] &&
[fieldsToWriteIfEmpty containsObject:key] == NO) {
+ if (inherit && isEmpty && [fieldsToWriteIfEmpty containsObject:key] ==
NO) {
BibItem *parent = [self crossrefParent];
value = nil;
if (parent) {
NSString *parentValue = [parent valueOfField:key
inherit:NO];
- if ([NSString isEmptyAsComplexString:parentValue] == NO)
+ isEmpty = [NSString isEmptyAsComplexString:parentValue];
+ if (isEmpty == NO)
value = [NSString
stringWithInheritedValue:parentValue];
}
}
// @@ empty fields: or should we return nil for empty fields?
- return [NSString isEmptyAsComplexString:value] ? @"" : value;
+ return isEmpty ? @"" : value;
}
#pragma mark Derived field values
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit