Bug 28085

Summary: Unnecessary 'goto' confuses flow of control in WebHTMLView
Product: WebKit Reporter: Jens Alfke <jens>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED CONFIGURATION CHANGED    
Severity: Normal CC: ahmad.saleem792, ap
Priority: P4    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   

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
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.