WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
28085
Unnecessary 'goto' confuses flow of control in WebHTMLView
https://bugs.webkit.org/show_bug.cgi?id=28085
Summary
Unnecessary 'goto' confuses flow of control in WebHTMLView
Jens Alfke
Reported
2009-08-07 14:14:20 PDT
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) { ... } }
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2023-10-20 07:27:02 PDT
I am unable to find 'goto' as of today:
https://searchfox.org/wubkat/source/Source/WebKitLegacy/mac/WebView/WebHTMLView.mm#4343
I think this might have changed over the years and this can be marked as 'RESOLVED CONFIGURATION CHANGED'? @Alexey - no idea, who would be right person to conclude on this.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug