Skip to content

Commit

Permalink
avoid two counters for DBScan.
Browse files Browse the repository at this point in the history
  • Loading branch information
badrishc committed Jan 15, 2025
1 parent 5970e48 commit 81ee245
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions libs/server/Storage/Session/Common/ArrayKeyIterationFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,9 @@ internal sealed class MainStoreGetDBSize : IScanIteratorFunctions<SpanByte, Span

public bool SingleReader(ref SpanByte key, ref SpanByte value, RecordMetadata recordMetadata, long numberOfRecords, out CursorRecordResult cursorRecordResult)
{
if (value.MetadataSize != 0 && MainSessionFunctions.CheckExpiry(ref value))
cursorRecordResult = CursorRecordResult.Skip;
else
cursorRecordResult = CursorRecordResult.Skip;
if (value.MetadataSize == 0 || !MainSessionFunctions.CheckExpiry(ref value))
{
cursorRecordResult = CursorRecordResult.Accept;
++info.count;
}
return true;
Expand All @@ -340,11 +338,9 @@ internal sealed class ObjectStoreGetDBSize : IScanIteratorFunctions<byte[], IGar

public bool SingleReader(ref byte[] key, ref IGarnetObject value, RecordMetadata recordMetadata, long numberOfRecords, out CursorRecordResult cursorRecordResult)
{
if (value.Expiration > 0 && ObjectSessionFunctions.CheckExpiry(value))
cursorRecordResult = CursorRecordResult.Skip;
else
cursorRecordResult = CursorRecordResult.Skip;
if (value.Expiration == 0 || !ObjectSessionFunctions.CheckExpiry(value))
{
cursorRecordResult = CursorRecordResult.Accept;
++info.count;
}
return true;
Expand Down

0 comments on commit 81ee245

Please sign in to comment.