mirror of
https://github.com/Qortal/qortal.git
synced 2025-03-26 23:44:34 +00:00
added support for limit set to zero or negative as no limit
This commit is contained in:
parent
187a360467
commit
27cc9e458e
@ -238,7 +238,7 @@ public class HSQLDBCacheUtils {
|
|||||||
if( offset.isPresent() ) stream = stream.skip(offset.get());
|
if( offset.isPresent() ) stream = stream.skip(offset.get());
|
||||||
|
|
||||||
// truncate to limit
|
// truncate to limit
|
||||||
if( limit.isPresent() ) stream = stream.limit(limit.get());
|
if( limit.isPresent() && limit.get() > 0 ) stream = stream.limit(limit.get());
|
||||||
|
|
||||||
// include metadata
|
// include metadata
|
||||||
if( includeMetadata.isEmpty() || !includeMetadata.get() )
|
if( includeMetadata.isEmpty() || !includeMetadata.get() )
|
||||||
|
@ -504,6 +504,20 @@ public class HSQLDBCacheUtilsTests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLimitZero() {
|
||||||
|
|
||||||
|
ArbitraryResourceData data = new ArbitraryResourceData();
|
||||||
|
data.name = "Joe";
|
||||||
|
|
||||||
|
filterListByMap(
|
||||||
|
List.of(data),
|
||||||
|
NAME_LEVEL,
|
||||||
|
new HashMap<>(Map.of(LIMIT, 0)),
|
||||||
|
1
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testOffset() {
|
public void testOffset() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user