[minor] reduce substr (#18611)

* minor

* correct

* unify the type of addrLen

* Update lib/packages/docutils/rstgen.nim
This commit is contained in:
flywind 2021-07-30 15:32:00 +08:00 • committed by GitHub
commit c6fadb1799
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View file

@ -675,7 +675,7 @@ proc readIndexDir(dir: string):
var x = fileEntries[0].link
let i = find(x, '#')
if i > 0:
x = x.substr(0, i-1)
x.setLen(i)
if i != 0:
# don't add entries starting with '#'
result.modules.add(x.changeFileExt(""))