aboutsummaryrefslogtreecommitdiffhomepage
path: root/tdutils
diff options
context:
space:
mode:
authorlevlam <levlam@telegram.org>2024-09-10 18:10:08 +0300
committerlevlam <levlam@telegram.org>2024-09-10 18:10:08 +0300
commitac8c0ee4e7f4016cb9c91decdcaa085277d276fb (patch)
tree3809d1019da5cfc699d8153d0471a9725a6d48e6 /tdutils
parentdcfd86c70c565c9c1d2f576a9ff0a769f2ef5e49 (diff)
Improve variable names.
Diffstat (limited to 'tdutils')
-rw-r--r--tdutils/td/utils/filesystem.cpp4
-rw-r--r--tdutils/test/StealingQueue.cpp10
-rw-r--r--tdutils/test/pq.cpp4
3 files changed, 9 insertions, 9 deletions
diff --git a/tdutils/td/utils/filesystem.cpp b/tdutils/td/utils/filesystem.cpp
index 8a9501fb7..80d9353a2 100644
--- a/tdutils/td/utils/filesystem.cpp
+++ b/tdutils/td/utils/filesystem.cpp
@@ -50,8 +50,8 @@ Result<T> read_file_impl(CSlice path, int64 size, int64 offset) {
size = file_size - offset;
}
auto content = create_empty<T>(narrow_cast<size_t>(size));
- TRY_RESULT(got_size, from_file.pread(as_mutable_slice(content), offset));
- if (got_size != static_cast<size_t>(size)) {
+ TRY_RESULT(read_size, from_file.pread(as_mutable_slice(content), offset));
+ if (read_size != static_cast<size_t>(size)) {
return Status::Error("Failed to read file");
}
from_file.close();
diff --git a/tdutils/test/StealingQueue.cpp b/tdutils/test/StealingQueue.cpp
index 0e48c1d33..0a2f0d083 100644
--- a/tdutils/test/StealingQueue.cpp
+++ b/tdutils/test/StealingQueue.cpp
@@ -108,7 +108,7 @@ TEST(AtomicRead, simple2) {
TEST(StealingQueue, simple) {
td::uint64 sum = 0;
- std::atomic<td::uint64> got_sum{0};
+ std::atomic<td::uint64> check_sum{0};
td::Stage run;
td::Stage check;
@@ -138,10 +138,10 @@ TEST(StealingQueue, simple) {
sum += x_sum[x];
gq.push(x, id);
}
- got_sum = 0;
+ check_sum = 0;
}
run.wait(round * threads_n);
- while (got_sum.load() != sum) {
+ while (check_sum.load() != sum) {
auto x = [&] {
int res;
if (lq[id].local_pop(res)) {
@@ -159,8 +159,8 @@ TEST(StealingQueue, simple) {
if (x == 0) {
continue;
}
- //LOG(ERROR) << x << " " << got_sum.load() << " " << sum;
- got_sum.fetch_add(x, std::memory_order_relaxed);
+ //LOG(ERROR) << x << " " << check_sum.load() << " " << sum;
+ check_sum.fetch_add(x, std::memory_order_relaxed);
lq[id].local_push(x - 1, [&](auto y) {
//LOG(ERROR) << "OVERFLOW";
gq.push(y, id);
diff --git a/tdutils/test/pq.cpp b/tdutils/test/pq.cpp
index fbe53eefb..b499b31e0 100644
--- a/tdutils/test/pq.cpp
+++ b/tdutils/test/pq.cpp
@@ -112,8 +112,8 @@ static void test_pq_slow(td::uint64 first, td::uint64 second) {
td::BigNum p_res = td::BigNum::from_binary(p_str);
td::BigNum q_res = td::BigNum::from_binary(q_str);
- LOG_CHECK(p_str == p.to_binary()) << td::tag("got", p_res.to_decimal()) << td::tag("expected", first);
- LOG_CHECK(q_str == q.to_binary()) << td::tag("got", q_res.to_decimal()) << td::tag("expected", second);
+ LOG_CHECK(p_str == p.to_binary()) << td::tag("receive", p_res.to_decimal()) << td::tag("expected", first);
+ LOG_CHECK(q_str == q.to_binary()) << td::tag("receive", q_res.to_decimal()) << td::tag("expected", second);
}
#endif