From f19caf9b96ba3cf5170397566138788eebf20e76 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 29 Oct 2025 22:41:53 -0400 Subject: [PATCH] No need to use map, just use an array. Duh. --- filters/posterize.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/filters/posterize.go b/filters/posterize.go index 9845b7a..80276c7 100644 --- a/filters/posterize.go +++ b/filters/posterize.go @@ -17,13 +17,13 @@ const ( type PosterizeFilter struct { Depth uint16 - Bins map[uint16]uint16 + Bins [math.MaxUint16]uint16 DitherType int } func Posterize(depth uint16, dither_type int) gift.Filter { var i uint16 - bins := make(map[uint16]uint16) + var bins [math.MaxUint16]uint16 chunk := uint16((math.MaxUint16 + 1) / int(depth)) // BUG: this was fine with uint8, now it's dumb as hell