Skip to content

Commit dae92a7

Browse files
committed
Perf: Use more BB(integerAsString:)
... faster.
1 parent 9fe1bce commit dae92a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/NIORedis/RESPChannelHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ open class RedisChannelHandler : ChannelInboundHandler,
121121
let count = array.count
122122
out = ctx.channel.allocator.buffer(capacity: 1 + 4 + 3 + count * 32)
123123
out.write(integer: UInt8(42)) // *
124-
out.write(string: String(array.count, radix: 10))
124+
out.write(integerAsString: array.count)
125125
out.write(bytes: eol)
126126
for item in array {
127127
encode(ctx: ctx, data: item, level: 1, out: &out)
@@ -229,7 +229,7 @@ open class RedisChannelHandler : ChannelInboundHandler,
229229
case .array(let array): // *
230230
if let array = array {
231231
out.write(integer: UInt8(42)) // *
232-
out.write(string: String(array.count, radix: 10))
232+
out.write(integerAsString: array.count)
233233
out.write(bytes: eol)
234234
for item in array {
235235
encode(ctx: ctx, data: item, level: level + 1, out: &out)

0 commit comments

Comments
 (0)