Permalink
Browse files

remove superfluous if condition

  • Loading branch information...
1 parent 765173c commit e2cd7404f6d9f2d92b5533101fe59d661753c70d @ssp committed Dec 12, 2010
Showing with 17 additions and 20 deletions.
  1. +16 −19 Plugin/CTFKillerYouTube.m
  2. +1 −1 README.markdown
View
@@ -117,33 +117,30 @@ - (void) setup {
}
}
}
-
}
else {
// it's an embedded YouTube flash view; scrub the URL to
// determine the video_id, then get the source of the YouTube
// page to get the Flash vars
- if ( myVideoID == nil ) {
- NSURL * ytURL = [NSURL URLWithString: srcURLString];
- NSString * host = [ytURL host];
- if (([host rangeOfString:@"youtube.com" options: NSAnchoredSearch | NSBackwardsSearch].location != NSNotFound) || ([host rangeOfString:@"youtube-nocookie.com" options: NSAnchoredSearch | NSBackwardsSearch].location != NSNotFound ) ) {
+ NSURL * ytURL = [NSURL URLWithString: srcURLString];
+ NSString * host = [ytURL host];
+ if (([host rangeOfString:@"youtube.com" options: NSAnchoredSearch | NSBackwardsSearch].location != NSNotFound) || ([host rangeOfString:@"youtube-nocookie.com" options: NSAnchoredSearch | NSBackwardsSearch].location != NSNotFound ) ) {
- NSString * path = [ytURL path];
- NSRange lastSlashRange = [path rangeOfString:@"/" options:NSLiteralSearch | NSBackwardsSearch];
- NSInteger lastSlash = lastSlashRange.location;
- NSRange firstAmpersandRange = [path rangeOfString:@"&" options:NSLiteralSearch];
- if ( lastSlash != NSNotFound ) {
- NSInteger firstAmpersand = firstAmpersandRange.location;
- if (firstAmpersand == NSNotFound) {
- firstAmpersand = [path length];
- }
- if (lastSlash < firstAmpersand ) {
- NSRange IDRange = NSMakeRange(lastSlash + 1, firstAmpersand - lastSlash - 1);
- myVideoID = [path substringWithRange:IDRange];
- }
+ NSString * path = [ytURL path];
+ NSRange lastSlashRange = [path rangeOfString:@"/" options:NSLiteralSearch | NSBackwardsSearch];
+ NSInteger lastSlash = lastSlashRange.location;
+ NSRange firstAmpersandRange = [path rangeOfString:@"&" options:NSLiteralSearch];
+ if ( lastSlash != NSNotFound ) {
+ NSInteger firstAmpersand = firstAmpersandRange.location;
+ if (firstAmpersand == NSNotFound) {
+ firstAmpersand = [path length];
}
- }
+ if (lastSlash < firstAmpersand ) {
+ NSRange IDRange = NSMakeRange(lastSlash + 1, firstAmpersand - lastSlash - 1);
+ myVideoID = [path substringWithRange:IDRange];
+ }
+ }
}
if (myVideoID != nil) {
View
@@ -29,7 +29,7 @@ I put out a few test versions over time. Those are close – but not quite ident
* current [ssp/cutting-edge Code](http://github.com/ssp/clicktoflash/tree/cutting-edge)
* download [ssp’s latest build](http://earthlingsoft.net/beta/ClickToFlash-ssp-latest.zip)
* [1.6b20-ssp](http://earthlingsoft.net/beta/ClickToFlash-1.6b20-ssp.zip)
- * Handle case of embedded Flash where the videoID is stored in flashvars but the movie URL isn’t by loading the movie info from YouTube ([https://rentzsch.lighthouseapp.com/projects/24342/tickets/758-quicktimeyoutube#ticket-758-10](#758/10):
+ * Handle case of embedded Flash where the videoID is stored in flashvars but the movie URL isn’t by loading the movie info from YouTube ([https://rentzsch.lighthouseapp.com/projects/24342/tickets/758-quicktimeyoutube#ticket-758-10](#758/10): 765173
* [1.6b19-ssp](http://earthlingsoft.net/beta/ClickToFlash-1.6b19-ssp.zip)
* Explicitly state that Flash isn’t installed, if necessary. An attempt to clarify the situation for users on new MacBook Airs (#776): ce82ded
* [1.6b18-ssp](http://earthlingsoft.net/beta/ClickToFlash-1.6b18-ssp.zip)

0 comments on commit e2cd740

Please sign in to comment.