This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol P { | |
func foo() | |
func bar() | |
} | |
extension P { | |
func foo() { print("foo() from P") } | |
func bar() { print("bar() from P") } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import ReactiveSwift | |
import Result | |
private func _measure(times: UInt64 = 2_000_000, label: String = #function, _ action: (() -> UInt64) -> Void) { | |
var result: UInt64 = 0 | |
var minResult: UInt64 = .max | |
for i in 0 ..< times { | |
var start: UInt64! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import ReactiveSwift | |
import Result | |
private func _measure(times: UInt64 = 2_000_000, label: String = #function, _ action: (() -> UInt64) -> Void) { | |
var result: UInt64 = 0 | |
var minResult: UInt64 = .max | |
for i in 0 ..< times { | |
var start: UInt64! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
private func _measure(times: UInt64 = 2_000_000, label: String = #function, _ action: (() -> UInt64) -> Void) { | |
var result: UInt64 = 0 | |
var minResult: UInt64 = .max | |
for i in 0 ..< times { | |
var start: UInt64! | |
action { | |
start = mach_absolute_time() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import ReactiveSwift | |
import Result | |
private func _measure(times: UInt64 = 2_000_000, label: String = #function, _ action: (() -> UInt64) -> Void) { | |
var result: UInt64 = 0 | |
var minResult: UInt64 = .max | |
for i in 0 ..< times { | |
var start: UInt64! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ManuallyFinishingOperation: BlockOperation { | |
override var isFinished: Bool { | |
return _isFinished && super.isFinished | |
} | |
var _isFinished: Bool = false { | |
willSet { willChangeValue(forKey: "isFinished") } | |
didSet { didChangeValue(forKey: "isFinished") } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import ReactiveSwift | |
import Result | |
private func _measure(times: UInt64 = 2_000_000, label: String = #function, _ action: (() -> UInt64) -> Void) { | |
var result: UInt64 = 0 | |
var minResult: UInt64 = .max | |
for i in 0 ..< times { | |
var start: UInt64! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import XCTest | |
import ReactiveSwift | |
import Result | |
class BagTests: XCTestCase { | |
func testCopying() { | |
var _bag = Bag<Int>() | |
_ = (0 ..< 32_768).map { _bag.insert($0) } | |
self.measure { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// `Entity` protocol. | |
protocol Entity: Codeable { | |
var identifier: UInt { get } | |
} | |
protocol EntityIdentifer: Codeable { | |
var identifier: UInt { get } | |
} | |
struct Identifier<E: Entity>: EntityIdentifer { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// LockTest.swift | |
// ReactiveSwift | |
// | |
// Created by Anders on 22/4/2017. | |
// Copyright © 2017 GitHub. All rights reserved. | |
// | |
import XCTest | |
@testable import ReactiveSwift |
NewerOlder