mirror of https://github.com/oxen-io/session-ios
				
				
				
			
			You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
	
	
		
			12 lines
		
	
	
		
			496 B
		
	
	
	
		
			Swift
		
	
			
		
		
	
	
			12 lines
		
	
	
		
			496 B
		
	
	
	
		
			Swift
		
	
| 
 | |
| /// Does nothing, but is never inlined and thus evaluating its argument will never be optimized away.
 | |
| ///
 | |
| /// Useful for forcing the instantiation of lazy properties like globals.
 | |
| @inline(never)
 | |
| public func touch<Value>(_ value: Value) { /* Do nothing */ }
 | |
| 
 | |
| /// Returns `f(x!)` if `x != nil`, or `nil` otherwise.
 | |
| public func given<T, U>(_ x: T?, _ f: (T) throws -> U) rethrows -> U? { return try x.map(f) }
 | |
| 
 | |
| public func with<T, U>(_ x: T, _ f: (T) throws -> U) rethrows -> U { return try f(x) }
 |