Skip to content

Commit

Permalink
Use while-let more
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsius committed May 6, 2024
1 parent ea0d30d commit b6c9286
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lisp/git-commit.el
Original file line number Diff line number Diff line change
Expand Up @@ -1256,8 +1256,8 @@ Added to `font-lock-extend-region-functions'."
(font-lock-ensure)
(with-no-warnings
(font-lock-fontify-buffer))))
(let (next (pos (point-min)))
(while (setq next (next-single-property-change pos 'face))
(let ((pos (point-min)))
(while-let ((next (next-single-property-change pos 'face)))
(put-text-property pos next 'font-lock-face
(get-text-property pos 'face))
(setq pos next))
Expand Down
5 changes: 2 additions & 3 deletions lisp/magit-diff.el
Original file line number Diff line number Diff line change
Expand Up @@ -1363,10 +1363,9 @@ for a revision."
(and (cl-typep section 'magit-file-section)
(equal (oref section value) file)))
(oref (or parent magit-root-section) children))))
(let ((hunk nil)
(hunks (oref diff children)))
(let ((hunks (oref diff children)))
(cl-block nil
(while (setq hunk (pop hunks))
(while-let ((hunk (pop hunks)))
(when-let ((range (oref hunk to-range)))
(pcase-let* ((`(,beg ,len) range)
(end (+ beg len)))
Expand Down

0 comments on commit b6c9286

Please sign in to comment.