From 0b5a0a6098d4ee31b62ed12a584f15f15196bca2 Mon Sep 17 00:00:00 2001 From: Chris Speciale Date: Wed, 10 Jul 2024 09:14:15 -0400 Subject: [PATCH] ArrayUtil: Set default value to null --- src/starling/utils/ArrayUtil.hx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/starling/utils/ArrayUtil.hx b/src/starling/utils/ArrayUtil.hx index 28fe867..3f66831 100644 --- a/src/starling/utils/ArrayUtil.hx +++ b/src/starling/utils/ArrayUtil.hx @@ -21,7 +21,7 @@ class ArrayUtil { * @param newSize The new size of the array. * @param defaultValue The value to fill new elements with. */ - public static function extend(arr:Array, newSize:Int, defaultValue:T):Void { + public static function extend(arr:Array, newSize:Int, defaultValue:T = null):Void { while (arr.length < newSize) { arr.push(defaultValue); } @@ -33,7 +33,7 @@ class ArrayUtil { * @param newSize The new size of the array. * @param defaultValue The value to fill new elements with when extending. */ - public static function resize(arr:Array, newSize:Int, defaultValue:T):Void { + public static function resize(arr:Array, newSize:Int, defaultValue:T = null):Void { if (newSize < arr.length) { truncate(arr, newSize); } else {