mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
8 lines
215 B
Swift
8 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))
|
|
}
|