File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
src/test/java/com/github/packageurl/internal Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -72,15 +72,14 @@ public class StringUtilBenchmark {
7272
7373 @ Setup
7474 public void setup () {
75- createDecodedData ();
76- createEncodedData ();
75+ createData ();
7776 }
7877
79- private void createDecodedData () {
78+ private void createData () {
8079 decodedData = new String [DATA_COUNT ];
81- for (int i = 0 ; i < DATA_COUNT ; i ++) {
80+ for (int i = 0 ; i < decodedData . length ; i ++) {
8281 char [] chars = new char [DECODED_LENGTH ];
83- for (int j = 0 ; j < DECODED_LENGTH ; j ++) {
82+ for (int j = 0 ; j < chars . length ; j ++) {
8483 if (RANDOM .nextDouble () < nonAsciiProb ) {
8584 chars [j ] = (char ) (Byte .MAX_VALUE + 1 + RANDOM .nextInt (Short .MAX_VALUE - Byte .MAX_VALUE - 1 ));
8685 } else {
@@ -89,9 +88,7 @@ private void createDecodedData() {
8988 }
9089 decodedData [i ] = new String (chars );
9190 }
92- }
9391
94- private void createEncodedData () {
9592 encodedData = new String [decodedData .length ];
9693 for (int i = 0 ; i < encodedData .length ; i ++) {
9794 encodedData [i ] = StringUtil .percentEncode (decodedData [i ]);
You can’t perform that action at this time.
0 commit comments