Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: FavIcon/IconExtraction.swift

Issue 29664569: Favicon: Issue 6245 - SwiftLinted project files (Closed)
Left Patch Set: Favicon: Issue 6245 - SwiftLinted project files Created Jan. 12, 2018, 4:50 p.m.
Right Patch Set: Removed the sorted_imports rule and reversed the import calls to be sorted alphabetically Created Feb. 19, 2018, 10:38 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « FavIcon/FavIcon.swift ('k') | FavIcon/URLRequestOperation.swift » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // 1 //
2 // FavIcon 2 // FavIcon
3 // Copyright © 2016 Leon Breedt 3 // Copyright © 2016 Leon Breedt
4 // 4 //
5 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // Licensed under the Apache License, Version 2.0 (the "License");
6 // you may not use this file except in compliance with the License. 6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at 7 // You may obtain a copy of the License at
8 // 8 //
9 // http://www.apache.org/licenses/LICENSE-2.0 9 // http://www.apache.org/licenses/LICENSE-2.0
10 // 10 //
11 // Unless required by applicable law or agreed to in writing, software 11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS, 12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and 14 // See the License for the specific language governing permissions and
15 // limitations under the License. 15 // limitations under the License.
16 // 16 //
17 17
18 import FavIcon.XMLDocument 18 import FavIcon.XMLDocument
19 import Foundation
20 19
21 /// Represents an icon size. 20 /// Represents an icon size.
22 struct IconSize: Hashable, Equatable { 21 struct IconSize: Hashable, Equatable {
23 var hashValue: Int { 22 var hashValue: Int {
24 return width.hashValue ^ height.hashValue 23 return width.hashValue ^ height.hashValue
25 } 24 }
26 25
27 static func == (lhs: IconSize, rhs: IconSize) -> Bool { 26 static func == (lhs: IconSize, rhs: IconSize) -> Bool {
28 return lhs.width == rhs.width && lhs.height == rhs.height 27 return lhs.width == rhs.width && lhs.height == rhs.height
29 } 28 }
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 for size in string.components(separatedBy: .whitespaces) { 307 for size in string.components(separatedBy: .whitespaces) {
309 let parts = size.components(separatedBy: "x") 308 let parts = size.components(separatedBy: "x")
310 if parts.count != 2 { continue } 309 if parts.count != 2 { continue }
311 if let width = Int(parts[0]), let height = Int(parts[1]) { 310 if let width = Int(parts[0]), let height = Int(parts[1]) {
312 sizes.append(IconSize(width: width, height: height)) 311 sizes.append(IconSize(width: width, height: height))
313 } 312 }
314 } 313 }
315 } 314 }
316 return sizes 315 return sizes
317 } 316 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld