加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-Fix-up-some-comments-in-addCountmeFlag.patch 1.59 KB
一键复制 编辑 原始数据 按行查看 历史
LuWu 提交于 2024-07-23 16:26 . libdnf:Fix countme bucket calculation
From a41a2803dc8b24c83ed85718746fa97c1502de3d 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.
Conflict:NA
Reference:https://github.com/rpm-software-management/libdnf/commit/a41a2803dc8b24c83ed85718746fa97c1502de3d
---
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 73a3d7b42..40b0b68ec 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);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化