1
0
mirror of https://github.com/square/okhttp.git synced 2025-07-29 17:41:17 +03:00

Fix/Simplify regex usage (#5059)

* Fix/Simplify regex usage

* Cleanup
This commit is contained in:
Yuri Schimke
2019-05-18 11:33:34 +01:00
committed by Jesse Wilson
parent fbfb5f8461
commit dcf5c8ceb6
4 changed files with 11 additions and 14 deletions

View File

@ -45,7 +45,7 @@ object DnsRecordCodec {
writeShort(0) // additional
val nameBuf = Buffer()
val labels = host.split('.').dropLastWhile { it.isEmpty() }.toTypedArray()
val labels = host.split('.').dropLastWhile { it.isEmpty() }
for (label in labels) {
val utf8ByteCount = label.utf8Size()
if (utf8ByteCount != label.length.toLong()) {