Skip to content

Commit

Permalink
Use aref instead of elt to access struct slots by number
Browse files Browse the repository at this point in the history
  • Loading branch information
andras-simonyi committed Jan 3, 2018
1 parent 14ec5ae commit 78cb85f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions citeproc-term.el
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"Compare terms T1 and T2.
The comparison is based on the term fields except the last one,
and relies on the alphabetical ordering of fields' string
content (see the function `citeproc--lib-string-content'). Return
1, -1 or 0 iff T1 precedes, succeeds or is equal according to the
content (see the function `citeproc-lib-s-content'). Return 1, -1
or 0 iff T1 precedes, succeeds or is equal according to the
ordering."
(cond ((not t2) 1)
((not t1) -1)
(t (let ((idx 1)
(result 0))
(while (and (= result 0) (< idx 7))
(let ((s1 (citeproc-s-content (elt t1 idx)))
(s2 (citeproc-s-content (elt t2 idx))))
(let ((s1 (citeproc-s-content (aref t1 idx)))
(s2 (citeproc-s-content (aref t2 idx))))
(cond ((string< s1 s2) (setq result 1))
((string> s1 s2) (setq result -1))))
(cl-incf idx)) result))))
Expand Down

0 comments on commit 78cb85f

Please sign in to comment.