Channel statistics improvements

This commit is contained in:
Ilya Laktyushin
2020-03-12 05:01:21 +04:00
parent d8b99880ea
commit f5dbf47b68
154 changed files with 6186 additions and 10908 deletions

View File

@@ -0,0 +1,12 @@
//
// GlobalHelpers.swift
// TrackingRecorder
//
// Created by Andrew Solovey on 07.09.2018.
// Copyright © 2018 Andrew Solovey. All rights reserved.
//
public func crop<Type>(_ lower: Type, _ val: Type, _ upper: Type) -> Type where Type : Comparable {
assert(lower < upper, "Invalid lover and upper values")
return max(lower, min(upper, val))
}