File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,26 +38,6 @@ private void addToCache(String val) {
3838 }
3939 }
4040
41- private void addToCache (byte [] val ) {
42- if (USE_CACHING && cachedBytes .size () < CACHE_SIZE && !cachedBytes .contains (val )) {
43- cachedBytes .add (val );
44- }
45- }
46-
47- private byte [] getFromBytesCache () {
48- if (!USE_CACHING || cachedBytes .isEmpty ()) {
49- return null ;
50- } else {
51- byte [] bytes = Randomly .fromList (cachedBytes );
52- if (bytes .length != 0 && Randomly .getBoolean ()) {
53- for (int i = 0 ; i < Randomly .smallNumber (); i ++) {
54- bytes [getInteger (0 , bytes .length )] = (byte ) ThreadLocalRandom .current ().nextInt ();
55- }
56- }
57- return bytes ;
58- }
59- }
60-
6141 private Long getFromLongCache () {
6242 if (!USE_CACHING || cachedLongs .isEmpty ()) {
6343 return null ;
@@ -266,16 +246,9 @@ public String getString() {
266246 }
267247
268248 public byte [] getBytes () {
269- if (cacheProbability ()) {
270- byte [] val = getFromBytesCache ();
271- if (val != null ) {
272- return val ;
273- }
274- }
275249 int size = Randomly .smallNumber ();
276250 byte [] arr = new byte [size ];
277251 ThreadLocalRandom .current ().nextBytes (arr );
278- addToCache (arr );
279252 return arr ;
280253 }
281254
You can’t perform that action at this time.
0 commit comments