Skip to content

Commit 45503cc

Browse files
committed
Remove the caching of bytes for now, since it causes errors
1 parent 7049e62 commit 45503cc

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

src/sqlancer/Randomly.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)