From 888e69899ef3de89c1019e275dccc8d7b5092b00 Mon Sep 17 00:00:00 2001 From: faiface <faiface@ksp.sk> Date: Fri, 2 Dec 2016 22:55:58 +0100 Subject: [PATCH] simplify AttrType.Size --- pixelgl/attr.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pixelgl/attr.go b/pixelgl/attr.go index 15b2542..cfae110 100644 --- a/pixelgl/attr.go +++ b/pixelgl/attr.go @@ -47,7 +47,7 @@ const ( // Size returns the size of a type in bytes. func (at AttrType) Size() int { - sizeOf := map[AttrType]int{ + return map[AttrType]int{ Int: 4, Float: 4, Vec2: 2 * 4, @@ -62,6 +62,5 @@ func (at AttrType) Size() int { Mat4: 4 * 4 * 4, Mat42: 4 * 2 * 4, Mat43: 4 * 3 * 4, - } - return sizeOf[at] + }[at] } -- GitLab