array float lists: make min grow step a power of 2

This commit is contained in:
Moritz Zwerger 2025-02-09 19:32:55 +01:00
parent dbd4752d09
commit faa2b10b51
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/*
* Minosoft
* Copyright (C) 2020-2023 Moritz Zwerger
* Copyright (C) 2020-2025 Moritz Zwerger
*
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
*
@ -35,7 +35,7 @@ class BufferedArrayFloatList(
private val nextGrowStep = when {
initialSize <= 0 -> FloatListUtil.DEFAULT_INITIAL_SIZE
initialSize <= 100 -> 100
initialSize <= 128 -> 128
else -> initialSize
}

View File

@ -35,7 +35,7 @@ class FragmentedArrayFloatList(
private val nextGrowStep = when {
growStep <= 0 -> FloatListUtil.DEFAULT_INITIAL_SIZE
growStep <= 100 -> 100
growStep <= 128 -> 128
else -> growStep
}