Skip to content

Commit

Permalink
Added expandPool for may be able to expand ReconstructBuilder pool be…
Browse files Browse the repository at this point in the history
…forehand
  • Loading branch information
hohserg1 committed Apr 24, 2020
1 parent 0b4d57b commit 48ffeff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "2.1"
version = "2.1.1"
group = "hohserg.endothermic" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Endothermic"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ class ReconstructBuilder[Self <: BaseUnpackedQuad] {
object ReconstructBuilder {
private val free = new collection.mutable.HashSet[ReconstructBuilder[_]]()

free ++= (1 to 50 map (_ => new ReconstructBuilder))
expandPool(50)

private def returnToPool(value: ReconstructBuilder[_]) = {
value.clear()
Expand All @@ -534,4 +534,8 @@ object ReconstructBuilder {
builder
}

def expandPool(count: Int): Unit = {
free ++= (1 to count map (_ => new ReconstructBuilder))
}

}

0 comments on commit 48ffeff

Please sign in to comment.