summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-02-19 22:19:41 +0100
committerLudovic Courtès <ludo@gnu.org>2021-02-23 15:24:47 +0100
commitdb45712a675ada5cadc56c758d92894059af91f9 (patch)
treec90796e07ef0bd6313e3af4dcf77ff3b5717a52c
parent3c548c3e0eade12d3e86b1201dbd95863ca64ea7 (diff)
downloadguix-db45712a675ada5cadc56c758d92894059af91f9.tar.gz
grafts: Inline 'grafting?' and 'set-grafting'.
As for 'current-target-system' & co., this makes sure we don't
needlessly allocate closures.

* guix/grafts.scm (grafting?, set-grafting): Inline.
-rw-r--r--guix/grafts.scm12
1 files changed, 6 insertions, 6 deletions
diff --git a/guix/grafts.scm b/guix/grafts.scm
index 910dcadc8a..fd8a108092 100644
--- a/guix/grafts.scm
+++ b/guix/grafts.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -323,14 +323,14 @@ DRV, and graft DRV itself to refer to those grafted dependencies."
   ;; Whether to honor package grafts by default.
   (make-parameter #t))
 
-(define (set-grafting enable?)
-  "This monadic procedure enables grafting when ENABLE? is true, and disables
-it otherwise.  It returns the previous setting."
+(define-inlinable (set-grafting enable?)
+  ;; This monadic procedure enables grafting when ENABLE? is true, and
+  ;; disables it otherwise.  It returns the previous setting.
   (lambda (store)
     (values (%graft? enable?) store)))
 
-(define (grafting?)
-  "Return a Boolean indicating whether grafting is enabled."
+(define-inlinable (grafting?)
+  ;; Return a Boolean indicating whether grafting is enabled.
   (lambda (store)
     (values (%graft?) store)))