Add markDirty method to endpoint

This commit is contained in:
DBotThePony 2022-10-10 18:04:37 +07:00
parent 6bde5ff954
commit 313a14f8d9
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -372,7 +372,7 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa
} }
} }
private val dirtyFields = ReferenceArraySet<IField<*>>(0) private val dirtyFields = ReferenceArraySet<IField<*>>(fields.size)
// use LinkedList because it is ensured memory is freed on LinkedList#clear // use LinkedList because it is ensured memory is freed on LinkedList#clear
private val mapBacklogs = Reference2ObjectOpenHashMap<Map<*, *>, LinkedList<Pair<Any?, (DataOutputStream) -> Unit>>>() private val mapBacklogs = Reference2ObjectOpenHashMap<Map<*, *>, LinkedList<Pair<Any?, (DataOutputStream) -> Unit>>>()
@ -397,6 +397,10 @@ class FieldSynchronizer(private val callback: Runnable, private val alwaysCallCa
} }
init { init {
markDirty()
}
fun markDirty() {
for (field in fields) { for (field in fields) {
field.markDirty(this) field.markDirty(this)
} }