jenkins-bot submitted this change.

View Change

Approvals: Rubin: Looks good to me, but someone else must approve Xqt: Looks good to me, approved jenkins-bot: Verified
[IMPR] use consecutive reference numbers for autogenerated links

currently free_number gives a randomized next free number for
autogenerated links because set is not ordered. Use a generator
instead.

Change-Id: I1d4489de77496579d77ff0cecf8550779454378b
---
M scripts/reflinks.py
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index 2104cca..bb889be 100755
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -350,9 +350,9 @@
with suppress(ValueError):
used_numbers.add(int(number))

- # iterator to give the next free number
- free_number = iter({str(i) for i in range(1, 1000) # should be enough
- if i not in used_numbers})
+ # generator to give the next free number
+ free_number = (str(i) for i in range(1, 1000) # should be enough
+ if i not in used_numbers)

for (g, d) in found_refs.items():
group = ''

To view, visit change 688324. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I1d4489de77496579d77ff0cecf8550779454378b
Gerrit-Change-Number: 688324
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: D3r1ck01 <xsavitar.wiki@aol.com>
Gerrit-Reviewer: MarcoAurelio <maurelio@tools.wmflabs.org>
Gerrit-Reviewer: Rubin <rubin.happy@gmail.com>
Gerrit-Reviewer: Xqt <info@gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged