Revision: 17980
          http://bibdesk.svn.sourceforge.net/bibdesk/?rev=17980&view=rev
Author:   hofman
Date:     2011-06-27 20:08:54 +0000 (Mon, 27 Jun 2011)

Log Message:
-----------
no need to create mutable array for one object

Modified Paths:
--------------
    trunk/bibdesk/BibDocument.m

Modified: trunk/bibdesk/BibDocument.m
===================================================================
--- trunk/bibdesk/BibDocument.m 2011-06-27 19:51:51 UTC (rev 17979)
+++ trunk/bibdesk/BibDocument.m 2011-06-27 20:08:54 UTC (rev 17980)
@@ -2424,20 +2424,18 @@
 }
 
 - (NSArray *)publicationsForURLFromPasteboard:(NSPasteboard *)pboard 
error:(NSError **)error {
-    
-    NSMutableArray *pubs = nil;
-    
+    NSArray *pubs = nil;
     NSURL *theURL = [WebView URLFromPasteboard:pboard];
     if (theURL) {
-        BibItem *newBI = [[[BibItem alloc] init] autorelease];
-        pubs = [NSMutableArray array];
+        BibItem *newBI = [[BibItem alloc] init];
         [newBI addFileForURL:theURL autoFile:NO runScriptHook:YES];
         [newBI setPubType:@"webpage"];
         [newBI setField:@"Lastchecked" toValue:[[NSDate date] 
dateDescription]];
         NSString *title = [WebView URLTitleFromPasteboard:pboard];
         if (title)
             [newBI setField:BDSKTitleString toValue:title];
-        [pubs addObject:newBI];
+        pubs = [NSArray arrayWithObject:newBI];
+        [newBI release];
     } else if (error) {
         *error = [NSError localErrorWithCode:kBDSKParserFailed 
localizedDescription:NSLocalizedString(@"Did not find expected URL on the 
pasteboard", @"Error description")];
     }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Bibdesk-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to