Skip to content

Commit 4c77245

Browse files
konstibobnormanrz
andauthored
Apply suggestions from code review
Co-authored-by: Norman Rzepka <code@normanrz.com>
1 parent d406e5e commit 4c77245

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/dev/zarr/zarrjava/store/S3Store.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public ByteBuffer get(String[] keys, long start) {
9393
GetObjectRequest req = GetObjectRequest.builder()
9494
.bucket(bucketName)
9595
.key(resolveKeys(keys))
96-
.range(start < 0 //dependant on where we start either fetch last or first bytes
96+
.range(start < 0 // negative start implies indexing from the end, i.e. last bytes
9797
? String.format("bytes=%d", start)
9898
: String.format("bytes=%d-", start))
9999
.build();

src/test/java/dev/zarr/zarrjava/store/OnlineS3StoreTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,7 @@ public void testReadSuffix() {
6565
StoreHandle storeHandle = storeHandleWithData();
6666
ByteBuffer fullBuffer = storeHandle.read();
6767
long size = fullBuffer.remaining();
68-
if (size < 20) {
69-
Assertions.fail("Store size is too small to test suffix read");
70-
}
68+
Assertions.assertsTrue(size >= 20, "Store size is too small to test suffix read");
7169

7270
ByteBuffer suffixBuffer = storeHandle.read(-10);
7371
Assertions.assertEquals(10, suffixBuffer.remaining());

0 commit comments

Comments
 (0)