Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
koculu committed Sep 6, 2024
1 parent c926bf3 commit a5abf3b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/ZoneTree/docs/ZoneTree/guide/TTL-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Following code demonstrates a TTL ZoneTree database with absolute expiration.
```C#
using var zoneTree = new ZoneTreeFactory<int, TTLValue<int>>()
.SetValueSerializer(new StructSerializer<TTLValue<int>>())
.SetIsDeletedDelegate((in TTLValue<int> x) => x.IsExpired)
.SetMarkValueDeletedDelegate(void (ref TTLValue<int> x) => x.Expire())
.SetIsDeletedDelegate((in int key, in TTLValue<int> value) => value.IsExpired)
.SetMarkValueDeletedDelegate(void (ref TTLValue<int> value) => value.Expire())
.OpenOrCreate();

var expiration = DateTime.UtcNow.AddSeconds(30);
Expand All @@ -26,8 +26,8 @@ Following code demonstrates a TTL ZoneTree database with sliding expiration.
```C#
using var zoneTree = new ZoneTreeFactory<int, TTLValue<int>>()
.SetValueSerializer(new StructSerializer<TTLValue<int>>())
.SetIsDeletedDelegate((in TTLValue<int> x) => x.IsExpired)
.SetMarkValueDeletedDelegate(void (ref TTLValue<int> x) => x.Expire())
.SetIsDeletedDelegate((in int key, in TTLValue<int> value) => value.IsExpired)
.SetMarkValueDeletedDelegate(void (ref TTLValue<int> value) => value.Expire())
.OpenOrCreate();

var expiration = DateTime.UtcNow.AddSeconds(30);
Expand Down
8 changes: 4 additions & 4 deletions src/ZoneTree/docs/ZoneTree/guide/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ In this example, -1 is used as the deletion marker for integer values:
```c#
using var zoneTree = new ZoneTreeFactory<int, int>()
// Additional stuff goes here
.SetIsDeletedDelegate((in int x) => x == -1)
.SetMarkValueDeletedDelegate((ref int x) => x = -1)
.SetIsDeletedDelegate((in int key, in int value) => value == -1)
.SetMarkValueDeletedDelegate((ref int value) => value = -1)
.OpenOrCreate();
```

Expand All @@ -116,8 +116,8 @@ Alternatively, if you're using a custom struct to manage deletions, you can conf
```c#
using var zoneTree = new ZoneTreeFactory<int, MyDeletableValueType>()
// Additional stuff goes here
.SetIsDeletedDelegate((in MyDeletableValueType x) => x.IsDeleted)
.SetMarkValueDeletedDelegate((ref MyDeletableValueType x) => x.IsDeleted = true)
.SetIsDeletedDelegate((in int key, in MyDeletableValueType value) => value.IsDeleted)
.SetMarkValueDeletedDelegate((ref MyDeletableValueType value) => value.IsDeleted = true)
.OpenOrCreate();
```

Expand Down

0 comments on commit a5abf3b

Please sign in to comment.