From d9da30265472ad116d00705d0dd858c20068b6c1 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Sun, 23 Jul 2023 00:33:21 +0800 Subject: [PATCH] Pre-allocate Dragonbox cache array (#13649) --- src/float/printer/dragonbox_cache.cr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/float/printer/dragonbox_cache.cr b/src/float/printer/dragonbox_cache.cr index eec330246d19..523af21da0b6 100644 --- a/src/float/printer/dragonbox_cache.cr +++ b/src/float/printer/dragonbox_cache.cr @@ -99,7 +99,7 @@ module Float::Printer::Dragonbox end CACHE = begin - cache = [] of WUInt::UInt128 + cache = Array(WUInt::UInt128).new(619) put(cache, 0xff77b1fcbebcdc4f_u64, 0x25e8e89c13bb0f7b_u64) put(cache, 0x9faacf3df73609b1_u64, 0x77b191618c54e9ad_u64) put(cache, 0xc795830d75038c1d_u64, 0xd59df5b9ef6a2418_u64)