Copilot commented on code in PR #890:
URL:
https://github.com/apache/skywalking-banyandb/pull/890#discussion_r2616984230
##########
banyand/measure/write_liaison.go:
##########
@@ -153,11 +157,16 @@ func (w *writeQueueCallback) Rev(ctx context.Context,
message bus.Message) (resp
}
}
}
- if len(es.metadataDocs) > 0 {
-
sendDocuments(data.TopicMeasureSeriesIndexInsert, es.metadataDocs)
+ if len(es.metadataDocs) > 0 && len(seriesMetadataBytes)
> 0 {
Review Comment:
The double condition check `len(es.metadataDocs) > 0 &&
len(seriesMetadataBytes) > 0` could be redundant. If marshaling succeeds
(marshalErr is nil), seriesMetadataBytes should already be non-empty when
metadataDocs is non-empty. The second check adds unnecessary complexity.
Consider checking only `len(seriesMetadataBytes) > 0` or verifying if an empty
slice can be returned from a successful Marshal of non-empty documents.
```suggestion
if len(seriesMetadataBytes) > 0 {
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]