libdnf/backport-Fix-up-some-comments-in-addCountmeFlag.patch
2024-07-02 06:40:42 +00:00

40 lines
1.5 KiB
Diff

From 9c6e1c90b96cdb44d0093e417bd5d2e710881f94 Mon Sep 17 00:00:00 2001
From: Michal Domonkos <mdomonko@redhat.com>
Date: Wed, 8 May 2024 12:05:16 +0200
Subject: [PATCH] Fix up some comments in addCountmeFlag()
The buckets aren't really an array that's indexed in the code, they're
just sequential numbers for the URL flag. Also clarify why we're using
"this window" instead of "the current position of the sliding window" in
the comments.
---
libdnf/repo/Repo.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libdnf/repo/Repo.cpp b/libdnf/repo/Repo.cpp
index 73a3d7b4..40b0b68e 100644
--- a/libdnf/repo/Repo.cpp
+++ b/libdnf/repo/Repo.cpp
@@ -873,6 +873,9 @@ void Repo::Impl::addCountmeFlag(LrHandle *handle) {
* This is to align the time window with an absolute point in time rather
* than the last counting event (which could facilitate tracking across
* multiple such events).
+ *
+ * In the below comments, the window's current position will be referred to
+ * as "this window" for brevity.
*/
auto logger(Log::getLogger());
@@ -933,7 +936,7 @@ void Repo::Impl::addCountmeFlag(LrHandle *handle) {
for (i = 0; i < COUNTME_BUCKETS.size(); ++i)
if (step < COUNTME_BUCKETS[i])
break;
- int bucket = i + 1; // Buckets are indexed from 1
+ int bucket = i + 1; // Buckets are numbered from 1
// Set the flag
std::string flag = "countme=" + std::to_string(bucket);
--
2.33.0