[bug#78419] daemon: Add const qualifier to comparison call operator.

Message ID 5d3bca40c80a4d4db2579a56dc0dde1aafce8976.1747208366.git.dariqq@posteo.net
State New
Headers
Series [bug#78419] daemon: Add const qualifier to comparison call operator. |

Commit Message

Dariqq May 14, 2025, 7:39 a.m. UTC
  * nix/libstore/build.cc (CompareGoalPtrs::operator()): Add const qualifier.

Change-Id: Ieccea071db53715ef808fe59c69429fe228b5f77
---
Hello,
I had to add this patch to build guix on Fedora 42 and got a template error without it.
It corresponds to this commit in nix from 2017:
https://github.com/NixOS/nix/commit/00e0c416ffccf6edb63fe7f4b01422915ff12f86

 nix/libstore/build.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


base-commit: 5f5d84beccc180f1b51474c0e47eb6e0d0c9175f
  

Patch

diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index a1f39d9a8bf..f80f69f2bb6 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -94,7 +94,7 @@  typedef std::shared_ptr<Goal> GoalPtr;
 typedef std::weak_ptr<Goal> WeakGoalPtr;
 
 struct CompareGoalPtrs {
-    bool operator() (const GoalPtr & a, const GoalPtr & b);
+    bool operator() (const GoalPtr & a, const GoalPtr & b) const;
 };
 
 /* Set of goals. */
@@ -192,7 +192,7 @@  protected:
 };
 
 
-bool CompareGoalPtrs::operator() (const GoalPtr & a, const GoalPtr & b) {
+bool CompareGoalPtrs::operator() (const GoalPtr & a, const GoalPtr & b) const{
     string s1 = a->key();
     string s2 = b->key();
     return s1 < s2;