[Webkit-unassigned] [Bug 25847] Clean up ClipboardMac

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 18 09:07:39 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25847


darin at apple.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #30437|review?                     |review+
               Flag|                            |




------- Comment #2 from darin at apple.com  2009-05-18 09:07 PDT -------
(From update of attachment 30437)
I think it's unnecessary to shout "NOTE".

There's no reason to have a default value for the "onlyFirstURL" boolean.

> +    if (!absoluteURLs) {
> +        if ([availableTypes containsObject:NSURLPboardType]) {

Using && here would avoid an otherwise-unnecessary level of if nesting. But I
think early return would be even better. One of the advantages of breaking
something into a separate function.

> +        // "URL" and "text/url-list" both map to NSURLPboardType in cocoaTypeFromMIMEType(), "URL" only wants the first URL

It's a little strange to have this same comment twice.

> +    unsigned count = [types count];
> +    for (unsigned i = 0; i < count; i++) {

As long as you are touching this code, the correct type here is NSUInteger
rather than unsigned. Same for the other count and index in
absoluteURLsFromPasteboardFilenames.

r=me


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list