Skip to content

Commit 08c194f

Browse files
dfa1claude
andauthored
refactor: make NativeCall.requireNative return void (#15)
Every caller uses it as a guard statement and discards the returned segment, so the fluent return was dead. Drop it. Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 720243e commit 08c194f

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

zstd/src/main/java/io/github/dfa1/zstd/NativeCall.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ private static String errorName(long code) {
5959
/// Guards a zero-copy entry point: the segment handed to zstd must be backed
6060
/// by native (off-heap) memory, since its address is dereferenced in C. Fails
6161
/// fast with a clear message instead of the FFM linker's cryptic error.
62-
static MemorySegment requireNative(MemorySegment seg, String name) {
62+
static void requireNative(MemorySegment seg, String name) {
6363
if (!seg.isNative()) {
6464
throw new IllegalArgumentException(
6565
name + " must be a native (off-heap) MemorySegment; got a heap segment");
6666
}
67-
return seg;
6867
}
6968

7069
/// Rethrows any `Throwable` as if unchecked, laundering the checked

0 commit comments

Comments
 (0)