Skip to content

Commit 609a9e2

Browse files
review changes
1 parent b57892b commit 609a9e2

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

framework/db/src/main/java/com/cloud/utils/db/Filter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public Filter(Class<?> clazz, String field, boolean ascending) {
5757
}
5858

5959
public Filter(long limit) {
60-
this(limit, true);
60+
this(limit, false);
6161
}
6262

6363
/**
@@ -68,10 +68,8 @@ public Filter(long limit) {
6868
public Filter(long limit, boolean randomize) {
6969
if (randomize) {
7070
_orderBy = " ORDER BY RAND()" ;
71-
_limit = limit;
72-
} else {
73-
_limit = limit;
7471
}
72+
_limit = limit;
7573
}
7674

7775
public Filter(Long offset, Long limit) {

framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1324,7 +1324,7 @@ public int batchExpunge(final SearchCriteria<T> sc, final Long batchSize) {
13241324
Filter filter = null;
13251325
final long batchSizeFinal = ObjectUtils.defaultIfNull(batchSize, 0L);
13261326
if (batchSizeFinal > 0) {
1327-
filter = new Filter(null, batchSizeFinal);
1327+
filter = new Filter(batchSizeFinal);
13281328
}
13291329
int expunged = 0;
13301330
int currentExpunged = 0;

0 commit comments

Comments
 (0)