mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
9 lines
215 B
Swift
9 lines
215 B
Swift
import Foundation
|
|
|
|
func alignUp(_ value: Int, alignment: Int) -> Int {
|
|
assert(((alignment - 1) & alignment) == 0)
|
|
|
|
let alignmentMask = alignment - 1
|
|
return ((value + alignmentMask) & (~alignmentMask))
|
|
}
|