1. evhan
  2. chicken-git

Commits

evhan  committed dfeec79

Use begin0 idiom for tree-fold

  • Participants
  • Parent commits e140120
  • Branches master

Comments (0)

Files changed (1)

File git.scm

View file
  • Ignore whitespace
     (git-index-write-tree (index->pointer index)))))
 
 (define (tree-fold kons knil tree #!optional (mode 'post))
-  (let ((state knil))
+  (begin0-let ((state knil))
     (git-tree-walk
      (tree->pointer tree)
      (lambda (path entry*)
        (set! state
          (kons path (pointer->tree-entry tree (git-tree-entry-dup entry*)) state)))
-     mode)
-    state))
+     mode)))
 
 (define (tree-entries tree)
   (tree-fold (lambda (path entry acc) (cons (cons path entry) acc)) '() tree))