From 4e29a70b7811a475f02fb7c37432be6dd6171bb5 Mon Sep 17 00:00:00 2001 From: Saxon Date: Thu, 15 Aug 2019 01:16:28 +0930 Subject: [PATCH] codec/h264/h264dec: made maxi faster and more readable --- codec/h264/h264dec/helpers.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/codec/h264/h264dec/helpers.go b/codec/h264/h264dec/helpers.go index d9780c29..c15b2416 100644 --- a/codec/h264/h264dec/helpers.go +++ b/codec/h264/h264dec/helpers.go @@ -44,7 +44,10 @@ func binToSlice(s string) ([]byte, error) { } func maxi(a, b int) int { - return int(math.Max(float64(a), float64(b))) + if a > b { + return a + } + return b } func mini(a, b int) int {