Replaced deprecated repeatStr() with repeat().

This commit is contained in:
Hans Raaf 2015-03-04 03:44:09 +01:00
commit b902ea887b
7 changed files with 14 additions and 14 deletions

View file

@ -144,7 +144,7 @@ when isMainModule:
discard """block:
var
TestFile: FileChallengePair
contents = repeatStr(2, "abcdefghijklmnopqrstuvwxyz")
contents = repeat("abcdefghijklmnopqrstuvwxyz", 2)
testFile.challenge = newScFileChallenge("foobar.test", FZoneCfg, contents.len.int32)
testFile.file = checksumStr(contents)
myAssets.add testFile"""

View file

@ -27,9 +27,9 @@ when isMainModule:
var res = t.map(proc(z: int): int = result = z * 10)
dumpSeq res
from strutils import toHex, repeatStr
from strutils import toHex
var foocakes = t.map(proc(z: int): string =
result = toHex((z * 23).biggestInt, 4))
result = toHex((z * 23).BiggestInt, 4))
dumpSeq foocakes
t.mapInPlace(proc(z: int): int = result = z * 30)

View file

@ -24,17 +24,17 @@ when isMainModule:
import strutils
var r = compress("Hello")
echo repr(r)
var l = "Hello".len
var rr = uncompress(r, l)
var ln = "Hello".len
var rr = uncompress(r, ln)
echo repr(rr)
assert rr == "Hello"
proc `*`(a: string; b: int): string {.inline.} = result = repeatStr(b, a)
proc `*`(a: string; b: int): string {.inline.} = result = repeat(a, b)
var s = "yo dude sup bruh homie" * 50
r = compress(s)
echo s.len, " -> ", r.len
l = s.len
rr = uncompress(r, l)
ln = s.len
rr = uncompress(r, ln)
echo r.len, " -> ", rr.len
assert rr == s

View file

@ -174,7 +174,7 @@ when isMainModule:
block:
var
TestFile: FileChallengePair
contents = repeatStr(2, "abcdefghijklmnopqrstuvwxyz")
contents = repeat("abcdefghijklmnopqrstuvwxyz", 2)
testFile.challenge = newScFileChallenge("foobar.test", FZoneCfg, contents.len.int32)
testFile.file = checksumStr(contents)
myAssets.add testFile