diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-09-24 19:41:03 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-09-24 19:41:03 +0200 |
commit | 35d0675467e61aff30c21544f87f55b1b1a2cfd3 (patch) | |
tree | dfbc48f1575e762352d60b55bb25facfa438875b /test/lisp/net | |
parent | 8fbf816ccd0fe223568d6c31c4571ca45dffaa8d (diff) | |
download | emacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.tar.gz emacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.tar.bz2 emacs-35d0675467e61aff30c21544f87f55b1b1a2cfd3.zip |
Prefer seq-random-elt to nth+random
* lisp/emacs-lisp/seq.el (seq-random-elt): Autoload.
* lisp/avoid.el (mouse-avoidance-random-shape):
* lisp/epa-ks.el (epa-ks--query-url):
* lisp/erc/erc-networks.el (erc-server-select):
* lisp/gnus/gnus-fun.el (gnus--random-face-with-type)
(gnus-fun-ppm-change-string):
* lisp/net/soap-inspect.el (soap-sample-value-for-xs-simple-type):
* lisp/obsolete/landmark.el (landmark-random-move):
* lisp/play/mpuz.el (mpuz-build-random-perm):
* lisp/play/zone.el (zone-pgm-stress):
* lisp/vc/add-log.el (add-change-log-entry):
* test/lisp/net/tramp-tests.el
(tramp-test44-asynchronous-requests): Prefer seq-random-elt to
nth+random.
Diffstat (limited to 'test/lisp/net')
-rw-r--r-- | test/lisp/net/tramp-tests.el | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el index 9f0264abc1b..f105c6f60ba 100644 --- a/test/lisp/net/tramp-tests.el +++ b/test/lisp/net/tramp-tests.el @@ -6787,8 +6787,7 @@ process sentinels. They shall not disturb each other." (let ((time (float-time)) (default-directory tmp-name) (file - (buffer-name - (nth (random (length buffers)) buffers))) + (buffer-name (seq-random-elt buffers))) ;; A remote operation in a timer could ;; confuse Tramp heavily. So we ignore this ;; error here. @@ -6853,7 +6852,7 @@ process sentinels. They shall not disturb each other." ;; the buffers. Mix with regular operation. (let ((buffers (copy-sequence buffers))) (while buffers - (let* ((buf (nth (random (length buffers)) buffers)) + (let* ((buf (seq-random-elt buffers)) (proc (get-buffer-process buf)) (file (process-get proc 'foo)) (count (process-get proc 'bar))) |