Skip to content

Commit

Permalink
don't need to bytes.Clone since []byte(string) copies already
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Mar 15, 2024
1 parent ec65218 commit 69a6635
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flow/connectors/kafka/kafka.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package connkafka

import (
"bytes"
"context"
"crypto/tls"
"errors"
Expand Down Expand Up @@ -197,7 +196,7 @@ func (c *KafkaConnector) SyncRecords(ctx context.Context, req *model.SyncRecords
return nil, fmt.Errorf("script returned non-nil non-string: %v", value)
}
wg.Add(1)
c.client.Produce(wgCtx, &kgo.Record{Topic: topic, Value: bytes.Clone([]byte(lstr))}, produceCb)
c.client.Produce(wgCtx, &kgo.Record{Topic: topic, Value: []byte(lstr)}, produceCb)

numRecords += 1
tableNameRowsMapping[topic] += 1
Expand Down

0 comments on commit 69a6635

Please sign in to comment.