Skip to content

Commit

Permalink
apply suggestion (delete unnecessary code)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mr committed Mar 8, 2021
1 parent c328346 commit 75ab616
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/packages/docutils/rst.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1444,11 +1444,8 @@ proc countTitles(p: var RstParser, n: PRstNode) =
if p.s.hTitleCnt >= 2:
break

proc tokenAfterNewline(p: RstParser, start = -1): int =
if start == -1:
result = p.idx
else:
result = start
proc tokenAfterNewline(p: RstParser, start: int): int =
result = start
while true:
case p.tok[result].kind
of tkEof:
Expand All @@ -1458,6 +1455,9 @@ proc tokenAfterNewline(p: RstParser, start = -1): int =
break
else: inc result

proc tokenAfterNewline(p: RstParser): int {.inline.} =
result = tokenAfterNewline(p, p.idx)

proc isAdornmentHeadline(p: RstParser, adornmentIdx: int): bool =
## check that underline/overline length is enough for the heading.
## No support for Unicode.
Expand Down
6 changes: 2 additions & 4 deletions lib/pure/strutils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1455,7 +1455,7 @@ since (1, 3):
func dedent*(s: string, count: Natural): string {.rtl, extern: "nsuDedent".} =
unindent(s, count, " ")

proc dedent*(a: string): string =
proc dedent*(a: string): string {.inline.} =
## Unindents each line in `s` by `count` amount of `padding`.
## The only difference between this and the
## `unindent func<#unindent,string,Natural,string>`_ is that this by default
Expand All @@ -1478,9 +1478,7 @@ since (1, 3):
""".dedent()

doAssert x == "Hello\n There\n"
let b = a
let i = indentation(b)
dedent(a, i)
dedent(a, indentation(a))

func delete*(s: var string, first, last: int) {.rtl, extern: "nsuDelete".} =
## Deletes in `s` (must be declared as `var`) the characters at positions
Expand Down

0 comments on commit 75ab616

Please sign in to comment.