Fix doc sample code.

This commit is contained in:
Ahmed Yasin Koculu
2026-07-06 00:00:59 +02:00
parent aa772ef347
commit abfd76aa63
+2 -2
View File
@@ -47,7 +47,7 @@ If the key is absent, ZoneTree writes `1`. If it is present, the updater receive
## Compare And Set
```csharp
var changed = zoneTree.TryAtomicGetAndUpdate(
var found = zoneTree.TryAtomicGetAndUpdate(
"order:123:state",
out var current,
(ref OrderState state) =>
@@ -60,7 +60,7 @@ var changed = zoneTree.TryAtomicGetAndUpdate(
});
```
`changed` is `false` only when the key is not found. If the key is found and the delegate returns `false`, the method still returns `true` because the read succeeded, but no new value is written.
`found` is `false` only when the key is not found. If the key is found and the delegate returns `false`, the method still returns `true` because the read succeeded, but no new value is written.
## Initialize Or Update With A Callback