[Webkit-unassigned] [Bug 28085] New: Unnecessary 'goto' confuses flow of control in WebHTMLView

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 7 14:14:21 PDT 2009


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

           Summary: Unnecessary 'goto' confuses flow of control in
                    WebHTMLView
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P4
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: snej at chromium.org


I was just looking through WebHTMLView and found this strange code in the
-namesOfPromisedFilesDroppedAtDestination: method:

- (NSArray *)namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination
{
    NSFileWrapper *wrapper = nil;
    NSURL *draggingImageURL = nil;

    if (WebCore::CachedImage* tiffResource = [self promisedDragTIFFDataSource])
{

        SharedBuffer *buffer =
static_cast<CachedResource*>(tiffResource)->data();
        if (!buffer)
            goto noPromisedData;

        ...
    }
noPromisedData:

There's no reason to use a goto there; maybe there was once some complex code
in between the goto and the label, but not currently. It can easily be
simplified to:

        if (buffer) {
            ...
        }
    }

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



More information about the webkit-unassigned mailing list