Skip to content

Commit

Permalink
Fix up some comments in addCountmeFlag()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dmnks authored and jan-kolarik committed Jun 6, 2024
1 parent bc37168 commit 9c6e1c9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libdnf/repo/Repo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 9c6e1c9

Please sign in to comment.