spullara/pattern — comment on commit 395f13f72ec603fb0233969f172b38016c66d223
File: src/main/java/com/github/spullara/java/util/regex/Pattern.java line 4797
By spullara:

Yeah, I considered a bunch of ways and I agree that this is a bit heavy, but it is also only during the compile step. My preferred way was probably to preallocate 50 or so and just waste the space. Using the ArrayList was problematic as it is pretty inefficient to loop over them when I'm trying to get rid of method calls down in the weeds.