Skip to content

Commit 5a6c04d

Browse files
authored
Eliminate more trivial backing 'val' storage (#374)
1 parent f9b3400 commit 5a6c04d

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

core/common/src/Segment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ internal abstract class SegmentCopyTracker {
5959
* Simple [SegmentCopyTracker] that always reports shared state.
6060
*/
6161
internal object AlwaysSharedCopyTracker : SegmentCopyTracker() {
62-
override val shared: Boolean = true
62+
override val shared: Boolean get() = true
6363
override fun addCopy() = Unit
6464
override fun removeCopy(): Boolean = true
6565
}

core/common/src/unsafe/UnsafeBufferOperations.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public object UnsafeBufferOperations {
1717
/**
1818
* Maximum value that is safe to pass to [writeToTail].
1919
*/
20-
public val maxSafeWriteCapacity: Int = Segment.SIZE
20+
public val maxSafeWriteCapacity: Int get() = Segment.SIZE
2121

2222
/**
2323
* Moves [bytes] to the end of the [buffer].

core/native/src/files/PathsNative.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public actual class Path internal constructor(
5454
}
5555
}
5656

57-
public actual val SystemPathSeparator: Char = UnixPathSeparator
57+
public actual val SystemPathSeparator: Char get() = UnixPathSeparator
5858

5959
internal expect fun dirnameImpl(path: String): String
6060

core/wasmWasi/src/files/FileSystemWasm.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public actual val SystemTemporaryDirectory: Path = Path("/tmp")
3131
* For example, if following directories were pre-opened: `/work`, `/tmp`, `/persistent`, then
3232
* the path `a/b/c/d` will be resolved to `/work/a/b/c/d` as `/work` is the first pre-opened directory.
3333
*/
34-
public actual val SystemFileSystem: FileSystem = WasiFileSystem
34+
public actual val SystemFileSystem: FileSystem get() = WasiFileSystem
3535

3636
@OptIn(UnsafeWasmMemoryApi::class)
3737
internal object WasiFileSystem : SystemFileSystemImpl() {
@@ -370,7 +370,7 @@ public actual open class FileNotFoundException actual constructor(
370370
) : IOException(message)
371371

372372
// The property affects only paths processing and in Wasi paths are always '/'-delimited.
373-
internal actual val isWindows: Boolean = false
373+
internal actual val isWindows: Boolean get() = false
374374

375375
internal object PreOpens {
376376
data class PreOpen(val path: Path, val fd: Int)

core/wasmWasi/src/files/PathsWasm.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ public actual class Path internal constructor(rawPath: String, @Suppress("UNUSED
5252

5353
// The path separator is always '/'.
5454
// https://github.com/WebAssembly/wasi-filesystem/blob/e79b05803e9ffd3b0cfdc0a8af20ac743abbe36a/wit/types.wit#L13C4-L13C71
55-
public actual val SystemPathSeparator: Char = UnixPathSeparator
55+
public actual val SystemPathSeparator: Char get() = UnixPathSeparator
5656

5757
public actual fun Path(path: String): Path = Path(path, null as Any?)

0 commit comments

Comments
 (0)