use const table for efficiency

Thanks StefanKarpinski for the tip.