Skip to content

Commit

Permalink
Use data, empty and size instead of Data, Empty and Size for TString (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
4JustMe4 authored Oct 28, 2024
1 parent 29fac51 commit 0c2b198
Show file tree
Hide file tree
Showing 11 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ydb/core/data_integrity_trails/data_integrity_trails.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace NKikimr {
namespace NDataIntegrity {

inline void LogKeyValue(const TString& key, const TString& value, TStringStream& ss, bool last = false) {
ss << key << ": " << (value.Empty() ? "Empty" : value) << (last ? "" : ",");
ss << key << ": " << (value.empty() ? "Empty" : value) << (last ? "" : ",");
}

template <class TransactionSettings>
Expand Down
12 changes: 6 additions & 6 deletions ydb/core/http_proxy/ut/ymq_ut.h
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ Y_UNIT_TEST_SUITE(TestYmqHttpProxy) {
UNIT_ASSERT_VALUES_EQUAL(json["Messages"][0]["Body"], body);

auto receiptHandle = json["Messages"][0]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle.Empty());
UNIT_ASSERT(!receiptHandle.empty());

DeleteMessage({{"QueueUrl", queueUrl}, {"ReceiptHandle", receiptHandle}, {"UnknownParameter", 123}}, 400);

Expand Down Expand Up @@ -785,9 +785,9 @@ Y_UNIT_TEST_SUITE(TestYmqHttpProxy) {
UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2);

auto receiptHandle0 = messages[0]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle0.Empty());
UNIT_ASSERT(!receiptHandle0.empty());
auto receiptHandle1 = messages[1]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle1.Empty());
UNIT_ASSERT(!receiptHandle1.empty());

json = DeleteMessageBatch({
{"QueueUrl", queueUrl},
Expand Down Expand Up @@ -885,7 +885,7 @@ Y_UNIT_TEST_SUITE(TestYmqHttpProxy) {

json = ReceiveMessage({{"QueueUrl", queueUrl}, {"WaitTimeSeconds", 20}});
auto receiptHandle = json["Messages"][0]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle.Empty());
UNIT_ASSERT(!receiptHandle.empty());

ChangeMessageVisibility({
{"QueueUrl", queueUrl},
Expand Down Expand Up @@ -933,9 +933,9 @@ Y_UNIT_TEST_SUITE(TestYmqHttpProxy) {
UNIT_ASSERT_VALUES_EQUAL(messages.size(), 2);

auto receiptHandle0 = messages[0]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle0.Empty());
UNIT_ASSERT(!receiptHandle0.empty());
auto receiptHandle1 = messages[1]["ReceiptHandle"].GetString();
UNIT_ASSERT(!receiptHandle1.Empty());
UNIT_ASSERT(!receiptHandle1.empty());

ChangeMessageVisibilityBatch({
{"QueueUrl", queueUrl},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ class TLdapAuthProvider : public NActors::TActorBootstrapped<TLdapAuthProvider>
return {{TEvLdapAuthProvider::EStatus::UNAUTHORIZED,
{.Message = ERROR_MESSAGE, .Retryable = false}}};
}
if (request.Password.Empty()) {
if (request.Password.empty()) {
LDAP_LOG_D("LDAP login failed for user " << TString(dn) << ". Empty password");
NKikimrLdap::MemFree(dn);
return {{.Status = TEvLdapAuthProvider::EStatus::UNAUTHORIZED, .Error = {.Message = TString(ERROR_MESSAGE) + ". Empty password", .Retryable = false}}};
Expand Down
4 changes: 2 additions & 2 deletions ydb/core/tx/datashard/erase_rows_condition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ class TExpirationCondition: public IEraseRowsCondition {
return value <= *wallClockSerialized;
case NScheme::NTypeIds::Pg: {
int result = NPg::PgNativeBinaryCompare(
value.Data(), value.Size(),
wallClockSerialized->Data(), wallClockSerialized->Size(),
value.data(), value.size(),
wallClockSerialized->data(), wallClockSerialized->size(),
Type.GetPgTypeDesc());
return result <= 0;
}
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/query_actor/query_actor_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Y_UNIT_TEST_SUITE(QueryActorTest) {
.Uint64(TableSize)
.Build();

RunStreamQuery(sql, &params, Value.Size() * 10);
RunStreamQuery(sql, &params, Value.size() * 10);
}

void OnStreamResult(NYdb::TResultSet&& resultSet) override {
Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/dq/opt/dq_opt_hypergraph_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ Y_UNIT_TEST_SUITE(HypergraphBuild) {
template<typename TLhsArg, typename TRhsArg>
std::shared_ptr<IBaseOptimizerNode> Join(const TLhsArg& lhsArg, const TRhsArg& rhsArg, TString on="", EJoinKind kind = EJoinKind::InnerJoin) {
if constexpr (std::is_convertible_v<TLhsArg, std::string> && std::is_convertible_v<TRhsArg, std::string>) {
if (on.Empty()) {
if (on.empty()) {
on = Sprintf("%s=%s", lhsArg, rhsArg);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ class TComputationGraph final : public IComputationGraph {
}
WriteUi64(result, taskStateSize);
for (auto it = taskState.begin(); it != taskState.end();) {
result.AppendNoAlias(it->Data(), it->Size());
result.AppendNoAlias(it->data(), it->size());
it = taskState.erase(it);
}
} else { // No load was done during previous runs (if any).
Expand Down Expand Up @@ -966,7 +966,7 @@ class TComputationPatternImpl final : public IComputationPattern {
auto lpos = s.rfind(flag);
if (lpos == TString::npos)
return TStringBuf();
lpos += flag.Size();
lpos += flag.size();
auto rpos = s.find(" --", lpos);
if (rpos == TString::npos)
return TStringBuf(s, lpos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void SaveGraphState(const NUdf::TUnboxedValue* roots, ui32 rootCount, ui64 hash,
}
WriteUi64(out, taskState.size());
if (!taskState.empty()) {
out.AppendNoAlias(taskState.Data(), taskState.size());
out.AppendNoAlias(taskState.data(), taskState.size());
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions ydb/library/yql/public/udf/udf_string_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,14 @@ class TStringRef : public TStringRefBase<true>
template<typename TStringType>
struct TByData {
static constexpr auto Get(const TStringType& buf) noexcept {
return buf.Data();
return buf.data();
}
};

template<typename TStringType>
struct TBySize {
static constexpr auto Get(const TStringType& buf) noexcept {
return buf.Size();
return buf.size();
}
};

Expand Down
2 changes: 1 addition & 1 deletion ydb/library/yql/tools/dqrun/dqrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ int RunProgram(TProgramPtr program, const TRunOptions& options, const THashMap<T
}
}

options.ResultOut->Write(str.Data(), str.Size());
options.ResultOut->Write(str.data(), str.size());
}
}

Expand Down
4 changes: 2 additions & 2 deletions ydb/library/yql/tools/yqlrun/yqlrun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ int Main(int argc, const char *argv[])
for (const auto& entry : TDirIterator(TFsPath(dirPath))) {
if (auto entryPath = TFsPath(entry.fts_path); entryPath.IsFile() && entryPath.GetExtension() == "txt") {
auto tableName = TString(clusterName).append('.').append(entryPath.RelativeTo(TFsPath(dirPath)).GetPath());
tableName = tableName.substr(0, tableName.Size() - 4); // remove .txt extension
tableName = tableName.substr(0, tableName.size() - 4); // remove .txt extension
tablesMapping[tableName] = entryPath.GetPath();
}
}
Expand Down Expand Up @@ -910,7 +910,7 @@ int Main(int argc, const char *argv[])
}
}

resultOut->Write(str.Data(), str.Size());
resultOut->Write(str.data(), str.size());
} else {
program->ResultsOut(*resultOut);
}
Expand Down

0 comments on commit 0c2b198

Please sign in to comment.