From 6ba43852a384cb73a7b086a41aff863214de7847 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 25 Feb 2024 16:29:52 +0700 Subject: [PATCH] Don't call observe() on write() --- gradle.properties | 2 +- src/main/kotlin/ru/dbotthepony/kommons/io/DelegateSyncher.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 01a38b3..7d4b79e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ kotlin.code.style=official specifyKotlinAsDependency=false projectGroup=ru.dbotthepony.kommons -projectVersion=2.9.10 +projectVersion=2.9.11 guavaDepVersion=33.0.0 gsonDepVersion=2.8.9 diff --git a/src/main/kotlin/ru/dbotthepony/kommons/io/DelegateSyncher.kt b/src/main/kotlin/ru/dbotthepony/kommons/io/DelegateSyncher.kt index d9e5735..873c2f7 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/io/DelegateSyncher.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/io/DelegateSyncher.kt @@ -757,10 +757,11 @@ class DelegateSyncher : Observer { /** * Returns null of this remote is clean. + * + * [DelegateSyncher.observe] is not called automatically for performance + * reasons, you must call it manually. */ fun write(): FastByteArrayOutputStream? { - this@DelegateSyncher.observe() - if (dirty.isNotEmpty()) { val data = FastByteArrayOutputStream() val stream = DataOutputStream(data)