@dmnks commented on this pull request.


> @@ -412,3 +415,43 @@ void rpmlog (int code, const char *fmt, ...)
 exit:
     errno = saved_errno;
 }
+
+int rpmlogOnce (uint64_t domain, const char * key, int code, const char *fmt, 
...)
+{
+    int saved_errno = errno;
+    rpmlogCtx ctx = rpmlogCtxAcquire();
+    int newkey = 0;
+
+    if (ctx) {
+       wrlock lock(ctx->mutex);
+       newkey = !ctx->seen[domain][{code, key}]++;

For me, the most confusing part is the increment vs. negation, it's not clear 
which one takes precedence (without looking it up in the C++ docs). I assume 
it's first incremented and only then negated, right?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3417#discussion_r1824137367
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3417/review/2407452...@github.com>
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to