Skip to content

Commit 3d1a2d4

Browse files
committed
Fix warnings
1 parent 2edecd3 commit 3d1a2d4

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/fb-cpp/Batch.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ Batch::Batch(Statement& statement, Transaction& transaction, const BatchOptions&
108108
assert(statement.isValid());
109109
assert(transaction.isValid());
110110

111-
const auto parBlock = buildParametersBlock(*client, options);
111+
const auto parBlock = buildParametersBlock(options);
112112

113113
handle.reset(statement.getStatementHandle()->createBatch(
114114
&statusWrapper, statement.getInputMetadata().get(), static_cast<unsigned>(parBlock.size()), parBlock.data()));
@@ -124,7 +124,7 @@ Batch::Batch(Attachment& attachment, Transaction& transaction, std::string_view
124124
assert(attachment.isValid());
125125
assert(transaction.isValid());
126126

127-
const auto parBlock = buildParametersBlock(*client, options);
127+
const auto parBlock = buildParametersBlock(options);
128128

129129
handle.reset(attachment.getHandle()->createBatch(&statusWrapper, transaction.getHandle().get(),
130130
static_cast<unsigned>(sql.length()), sql.data(), dialect, nullptr, static_cast<unsigned>(parBlock.size()),
@@ -164,7 +164,7 @@ BlobId Batch::addBlob(std::span<const std::byte> data, const BlobOptions& bpb)
164164
{
165165
assert(isValid());
166166

167-
const auto preparedBpb = prepareBpb(*client, bpb);
167+
const auto preparedBpb = prepareBpb(bpb);
168168

169169
BlobId blobId;
170170
handle->addBlob(&statusWrapper, static_cast<unsigned>(data.size()), data.data(), &blobId.id,
@@ -199,7 +199,7 @@ void Batch::setDefaultBpb(const BlobOptions& bpb)
199199
{
200200
assert(isValid());
201201

202-
const auto preparedBpb = prepareBpb(*client, bpb);
202+
const auto preparedBpb = prepareBpb(bpb);
203203
handle->setDefaultBpb(&statusWrapper, static_cast<unsigned>(preparedBpb.size()), preparedBpb.data());
204204
}
205205

@@ -258,9 +258,9 @@ const std::vector<Descriptor>& Batch::getInputDescriptors()
258258

259259
// --- Internal helpers ---
260260

261-
std::vector<std::uint8_t> Batch::buildParametersBlock(Client& client, const BatchOptions& options)
261+
std::vector<std::uint8_t> Batch::buildParametersBlock(const BatchOptions& options)
262262
{
263-
auto builder = fbUnique(client.getUtil()->getXpbBuilder(&statusWrapper, fb::IXpbBuilder::BATCH, nullptr, 0));
263+
auto builder = fbUnique(client->getUtil()->getXpbBuilder(&statusWrapper, fb::IXpbBuilder::BATCH, nullptr, 0));
264264

265265
if (options.getMultiError())
266266
builder->insertInt(&statusWrapper, fb::IBatch::TAG_MULTIERROR, 1);
@@ -286,9 +286,9 @@ std::vector<std::uint8_t> Batch::buildParametersBlock(Client& client, const Batc
286286
return {buffer, buffer + length};
287287
}
288288

289-
std::vector<std::uint8_t> Batch::prepareBpb(Client& client, const BlobOptions& bpb)
289+
std::vector<std::uint8_t> Batch::prepareBpb(const BlobOptions& bpb)
290290
{
291-
auto builder = fbUnique(client.getUtil()->getXpbBuilder(&statusWrapper, fb::IXpbBuilder::BPB,
291+
auto builder = fbUnique(client->getUtil()->getXpbBuilder(&statusWrapper, fb::IXpbBuilder::BPB,
292292
reinterpret_cast<const std::uint8_t*>(bpb.getBpb().data()), static_cast<unsigned>(bpb.getBpb().size())));
293293

294294
if (const auto type = bpb.getType(); type.has_value())

src/fb-cpp/Batch.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ namespace fbcpp
439439
///
440440

441441
private:
442-
std::vector<std::uint8_t> buildParametersBlock(Client& client, const BatchOptions& options);
443-
std::vector<std::uint8_t> prepareBpb(Client& client, const BlobOptions& bpb);
442+
std::vector<std::uint8_t> buildParametersBlock(const BatchOptions& options);
443+
std::vector<std::uint8_t> prepareBpb(const BlobOptions& bpb);
444444
void buildInputDescriptors();
445445

446446
private:

0 commit comments

Comments
 (0)